Class MemoryUtil

java.lang.Object
org.apache.arrow.memory.util.MemoryUtil

public class MemoryUtil extends Object
Utilities for memory related operations.
  • Field Details

    • UNSAFE

      public static final sun.misc.Unsafe UNSAFE
      The unsafe object from which to access the off-heap memory.
    • BYTE_ARRAY_BASE_OFFSET

      public static final long BYTE_ARRAY_BASE_OFFSET
      The start offset of array data relative to the start address of the array object.
    • LITTLE_ENDIAN

      public static final boolean LITTLE_ENDIAN
      If the native byte order is little-endian.
  • Method Details

    • getByteBufferAddress

      public static long getByteBufferAddress(ByteBuffer buf)
      Given a ByteBuffer, gets the address the underlying memory space.
      Parameters:
      buf - the byte buffer.
      Returns:
      address of the underlying memory.
    • directBuffer

      public static ByteBuffer directBuffer(long address, int capacity)
      Create nio byte buffer.
    • copyMemory

      public static void copyMemory(@Nullable Object srcBase, long srcOffset, @Nullable Object destBase, long destOffset, long bytes)