Construct an Arrow buffer from org.apache.arrow.memory.ArrowBuf Parameters ---------- jvm_buf: org.apache.arrow.memory.ArrowBuf Arrow Buffer representation on the JVM. Returns ------- pyarrow.Buffer Python Buffer that references the JVM memory.
(jvm_buf)
| 49 | |
| 50 | |
| 51 | def jvm_buffer(jvm_buf): |
| 52 | """ |
| 53 | Construct an Arrow buffer from org.apache.arrow.memory.ArrowBuf |
| 54 | |
| 55 | Parameters |
| 56 | ---------- |
| 57 | |
| 58 | jvm_buf: org.apache.arrow.memory.ArrowBuf |
| 59 | Arrow Buffer representation on the JVM. |
| 60 | |
| 61 | Returns |
| 62 | ------- |
| 63 | pyarrow.Buffer |
| 64 | Python Buffer that references the JVM memory. |
| 65 | """ |
| 66 | nanny = _JvmBufferNanny(jvm_buf) |
| 67 | address = jvm_buf.memoryAddress() |
| 68 | size = jvm_buf.capacity() |
| 69 | return pa.foreign_buffer(address, size, base=nanny) |
| 70 | |
| 71 | |
| 72 | def _from_jvm_int_type(jvm_type): |
no test coverage detected