public abstract class MemoryUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static boolean |
INVERTED_ORDER |
Constructor and Description |
---|
MemoryUtil() |
Modifier and Type | Method and Description |
---|---|
static long |
allocate(long size) |
static java.nio.ByteBuffer |
duplicateDirectByteBuffer(java.nio.ByteBuffer source,
java.nio.ByteBuffer hollowBuffer) |
static void |
free(long peer) |
static long |
getAddress(java.nio.ByteBuffer buffer) |
static java.lang.Object |
getAttachment(java.nio.ByteBuffer instance) |
static byte |
getByte(long address) |
static java.nio.ByteBuffer |
getByteBuffer(long address,
int length) |
static java.nio.ByteBuffer |
getByteBuffer(long address,
int length,
java.nio.ByteOrder order) |
static void |
getBytes(long address,
byte[] buffer,
int bufferOffset,
int count)
Transfers count bytes from Memory starting at memoryOffset to buffer starting at bufferOffset
|
static java.nio.ByteBuffer |
getHollowByteBuffer() |
static java.nio.ByteBuffer |
getHollowDirectByteBuffer() |
static java.nio.ByteBuffer |
getHollowDirectByteBuffer(java.nio.ByteOrder order) |
static int |
getInt(long address) |
static int |
getIntByByte(long address) |
static long |
getLong(long address) |
static long |
getLongByByte(long address) |
static int |
getShort(long address) |
static int |
getShortByByte(long address) |
static boolean |
isExactlyDirect(java.nio.ByteBuffer buffer) |
static int |
pageSize() |
static void |
putIntByByte(long address,
int value) |
static void |
putLongByByte(long address,
long value) |
static void |
setAttachment(java.nio.ByteBuffer instance,
java.lang.Object next) |
static void |
setByte(long address,
byte b) |
static void |
setByte(long address,
int count,
byte b) |
static void |
setByteBufferCapacity(java.nio.ByteBuffer instance,
int capacity) |
static void |
setBytes(byte[] src,
int offset,
long trg,
long count) |
static void |
setBytes(long address,
byte[] buffer,
int bufferOffset,
int count)
Transfers count bytes from buffer to Memory
|
static void |
setBytes(long address,
java.nio.ByteBuffer buffer) |
static void |
setBytes(long src,
long trg,
long count) |
static void |
setDirectByteBuffer(java.nio.ByteBuffer instance,
long address,
int length) |
static void |
setInt(long address,
int l) |
static void |
setLong(long address,
long l) |
static void |
setShort(long address,
short s) |
static java.nio.ByteBuffer |
sliceDirectByteBuffer(java.nio.ByteBuffer source,
java.nio.ByteBuffer hollowBuffer,
int offset,
int length) |
public static int pageSize()
public static long getAddress(java.nio.ByteBuffer buffer)
public static long allocate(long size)
public static void free(long peer)
public static void setByte(long address, byte b)
public static void setByte(long address, int count, byte b)
public static void setShort(long address, short s)
public static void setInt(long address, int l)
public static void setLong(long address, long l)
public static byte getByte(long address)
public static int getShort(long address)
public static int getInt(long address)
public static long getLong(long address)
public static java.nio.ByteBuffer getByteBuffer(long address, int length)
public static java.nio.ByteBuffer getByteBuffer(long address, int length, java.nio.ByteOrder order)
public static java.nio.ByteBuffer getHollowDirectByteBuffer()
public static java.nio.ByteBuffer getHollowDirectByteBuffer(java.nio.ByteOrder order)
public static java.nio.ByteBuffer getHollowByteBuffer()
public static boolean isExactlyDirect(java.nio.ByteBuffer buffer)
public static java.lang.Object getAttachment(java.nio.ByteBuffer instance)
public static void setAttachment(java.nio.ByteBuffer instance, java.lang.Object next)
public static java.nio.ByteBuffer duplicateDirectByteBuffer(java.nio.ByteBuffer source, java.nio.ByteBuffer hollowBuffer)
public static java.nio.ByteBuffer sliceDirectByteBuffer(java.nio.ByteBuffer source, java.nio.ByteBuffer hollowBuffer, int offset, int length)
public static void setDirectByteBuffer(java.nio.ByteBuffer instance, long address, int length)
public static void setByteBufferCapacity(java.nio.ByteBuffer instance, int capacity)
public static long getLongByByte(long address)
public static int getIntByByte(long address)
public static int getShortByByte(long address)
public static void putLongByByte(long address, long value)
public static void putIntByByte(long address, int value)
public static void setBytes(long address, java.nio.ByteBuffer buffer)
public static void setBytes(long address, byte[] buffer, int bufferOffset, int count)
address
- start offset in the memorybuffer
- the data bufferbufferOffset
- start offset of the buffercount
- number of bytes to transferpublic static void setBytes(long src, long trg, long count)
public static void setBytes(byte[] src, int offset, long trg, long count)
public static void getBytes(long address, byte[] buffer, int bufferOffset, int count)
address
- start offset in the memorybuffer
- the data bufferbufferOffset
- start offset of the buffercount
- number of bytes to transferCopyright © 2009-2021 The Apache Software Foundation