Package org.apache.arrow.memory.util
Class MemoryUtil
java.lang.Object
org.apache.arrow.memory.util.MemoryUtil
Utilities for memory related operations.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final long
The start offset of array data relative to the start address of the array object.static final boolean
If the native byte order is little-endian.static final sun.misc.Unsafe
The unsafe object from which to access the off-heap memory. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
copyMemory
(@Nullable Object srcBase, long srcOffset, @Nullable Object destBase, long destOffset, long bytes) static ByteBuffer
directBuffer
(long address, int capacity) Create nio byte buffer.static long
Given aByteBuffer
, gets the address the underlying memory space.
-
Field Details
-
UNSAFE
public static final sun.misc.Unsafe UNSAFEThe unsafe object from which to access the off-heap memory. -
BYTE_ARRAY_BASE_OFFSET
public static final long BYTE_ARRAY_BASE_OFFSETThe start offset of array data relative to the start address of the array object. -
LITTLE_ENDIAN
public static final boolean LITTLE_ENDIANIf the native byte order is little-endian.
-
-
Method Details
-
getByteBufferAddress
Given aByteBuffer
, gets the address the underlying memory space.- Parameters:
buf
- the byte buffer.- Returns:
- address of the underlying memory.
-
directBuffer
Create nio byte buffer. -
copyMemory
-