public class MemoryUtil extends Object
Modifier and Type | Field and Description |
---|---|
static long |
BYTE_ARRAY_BASE_OFFSET
The start offset of array data relative to the start address of the array object.
|
static boolean |
LITTLE_ENDIAN
If the native byte order is little-endian.
|
static sun.misc.Unsafe |
UNSAFE
The unsafe object from which to access the off-heap memory.
|
Modifier and Type | Method and Description |
---|---|
static ByteBuffer |
directBuffer(long address,
int capacity)
Create nio byte buffer.
|
static long |
getByteBufferAddress(ByteBuffer buf)
Given a
ByteBuffer , gets the address the underlying memory space. |
public static final sun.misc.Unsafe UNSAFE
public static final long BYTE_ARRAY_BASE_OFFSET
public static final boolean LITTLE_ENDIAN
public static long getByteBufferAddress(ByteBuffer buf)
ByteBuffer
, gets the address the underlying memory space.buf
- the byte buffer.public static ByteBuffer directBuffer(long address, int capacity)
Copyright © 2023 The Apache Software Foundation. All rights reserved.