public final class XMemory extends Object
| Modifier and Type | Method and Description |
|---|---|
static long |
allocate(long bytes) |
static ByteBuffer |
allocateDirectNative(int capacity)
Alias for
ByteBuffer.allocateDirect(capacity).order(ByteOrder.nativeOrder()). |
static ByteBuffer |
allocateDirectNative(long capacity) |
static ByteBuffer |
allocateDirectNativeDefault() |
static byte[] |
asByteArray(long value) |
static byte[] |
asByteArray(long[] longArray) |
static int |
bitSize_boolean() |
static int |
bitSize_byte() |
static int |
bitSize_char() |
static int |
bitSize_double() |
static int |
bitSize_float() |
static int |
bitSize_int() |
static int |
bitSize_long() |
static int |
bitSize_short() |
static int |
byteSize_boolean() |
static int |
byteSize_byte() |
static int |
byteSize_char() |
static int |
byteSize_double() |
static int |
byteSize_float() |
static int |
byteSize_int() |
static int |
byteSize_long() |
static int |
byteSize_short() |
static long |
byteSizeArray_boolean(long elementCount) |
static long |
byteSizeArray_byte(long elementCount) |
static long |
byteSizeArray_char(long elementCount) |
static long |
byteSizeArray_double(long elementCount) |
static long |
byteSizeArray_float(long elementCount) |
static long |
byteSizeArray_int(long elementCount) |
static long |
byteSizeArray_long(long elementCount) |
static long |
byteSizeArray_short(long elementCount) |
static long |
byteSizeArrayObject(long elementCount) |
static int |
byteSizeFieldValue(Class<?> type) |
static int |
byteSizeFieldValue(Field field) |
static int |
byteSizeInstance(Class<?> c) |
static int |
byteSizeObjectHeader(Class<?> c) |
static int |
byteSizePrimitive(Class<?> type) |
static int |
byteSizeReference() |
static ByteBuffer |
capLimit(ByteBuffer buffer,
long limit) |
static ByteBuffer |
clearForLimit(ByteBuffer buffer,
long limit) |
static void |
copyArrayToAddress(boolean[] array,
long targetAddress) |
static void |
copyArrayToAddress(byte[] array,
long targetAddress) |
static void |
copyArrayToAddress(char[] array,
long targetAddress) |
static void |
copyArrayToAddress(double[] array,
long targetAddress) |
static void |
copyArrayToAddress(float[] array,
long targetAddress) |
static void |
copyArrayToAddress(int[] array,
long targetAddress) |
static void |
copyArrayToAddress(long[] array,
long targetAddress) |
static void |
copyArrayToAddress(short[] array,
long targetAddress) |
static void |
copyRange(long sourceAddress,
long targetAddress,
long length) |
static void |
copyRangeToArray(long sourceAddress,
boolean[] target) |
static void |
copyRangeToArray(long sourceAddress,
byte[] target) |
static void |
copyRangeToArray(long sourceAddress,
char[] target) |
static void |
copyRangeToArray(long sourceAddress,
double[] target) |
static void |
copyRangeToArray(long sourceAddress,
float[] target) |
static void |
copyRangeToArray(long sourceAddress,
int[] target) |
static void |
copyRangeToArray(long sourceAddress,
long[] target) |
static void |
copyRangeToArray(long sourceAddress,
short[] target) |
static boolean |
deallocateDirectByteBuffer(ByteBuffer directBuffer) |
static int |
defaultBufferSize()
Arbitrary value that coincidently matches most hardware's standard page
sizes without being hard-tied to an actual pageSize system value.
|
static void |
ensureClassInitialized(Class<?> c) |
static void |
ensureClassInitialized(Class<?> c,
Iterable<Field> usedFields) |
static void |
fillMemory(long address,
long length,
byte value) |
static void |
free(long address) |
static boolean |
get_boolean(long address) |
static boolean |
get_boolean(Object instance,
long offset) |
static byte |
get_byte(long address) |
static byte |
get_byte(Object instance,
long offset) |
static char |
get_char(long address) |
static char |
get_char(Object instance,
long offset) |
static double |
get_double(long address) |
static double |
get_double(Object instance,
long offset) |
static float |
get_float(long address) |
static float |
get_float(Object instance,
long offset) |
static int |
get_int(long address) |
static int |
get_int(Object instance,
long offset) |
static long |
get_long(long address) |
static long |
get_long(Object instance,
long offset) |
static short |
get_short(long address) |
static short |
get_short(Object instance,
long offset) |
static long |
getDirectByteBufferAddress(ByteBuffer directBuffer) |
static Object |
getObject(Object instance,
long offset) |
static long |
getPositionLimit(ByteBuffer buffer) |
static ByteBuffer |
guaranteeDirectByteBuffer(ByteBuffer directBuffer) |
static void |
guaranteeUsability() |
static <T> T |
instantiateBlank(Class<T> c) |
static boolean |
isBigEndianNativeOrder() |
static boolean |
isDirectByteBuffer(ByteBuffer byteBuffer) |
static boolean |
isLittleEndianNativeOrder() |
static MemoryAccessor |
memoryAccessor() |
static MemoryAccessor |
memoryAccessorReversing() |
static MemorySizeProperties |
memorySizeProperties() |
static ByteOrder |
nativeByteOrder() |
static long |
objectFieldOffset(Class<?> c,
Field field) |
static long |
objectFieldOffset(Field field) |
static long[] |
objectFieldOffsets(Class<?> c,
Field[] fields) |
static long[] |
objectFieldOffsets(Field[] fields) |
static int |
pageSize() |
static ByteOrder |
parseByteOrder(String name)
Parses a
String instance to a ByteOrder instance according to ByteOrder#toString()
or throws an IllegalArgumentException if the passed string does not match exactely one of the
ByteOrder constant instances' string representation. |
static long |
reallocate(long address,
long bytes) |
static void |
set_boolean(long address,
boolean value) |
static void |
set_boolean(Object instance,
long offset,
boolean value) |
static void |
set_booleanInBytes(byte[] bytes,
int index,
boolean value) |
static void |
set_byte(long address,
byte value) |
static void |
set_byte(Object instance,
long offset,
byte value) |
static void |
set_byteInBytes(byte[] bytes,
int index,
byte value) |
static void |
set_char(long address,
char value) |
static void |
set_char(Object instance,
long offset,
char value) |
static void |
set_charInBytes(byte[] bytes,
int index,
char value) |
static void |
set_double(long address,
double value) |
static void |
set_double(Object instance,
long offset,
double value) |
static void |
set_doubleInBytes(byte[] bytes,
int index,
double value) |
static void |
set_float(long address,
float value) |
static void |
set_float(Object instance,
long offset,
float value) |
static void |
set_floatInBytes(byte[] bytes,
int index,
float value) |
static void |
set_int(long address,
int value) |
static void |
set_int(Object instance,
long offset,
int value) |
static void |
set_intInBytes(byte[] bytes,
int index,
int value) |
static void |
set_long(long address,
long value) |
static void |
set_long(Object instance,
long offset,
long value) |
static void |
set_longInBytes(byte[] bytes,
int index,
long value) |
static void |
set_short(long address,
short value) |
static void |
set_short(Object instance,
long offset,
short value) |
static void |
set_shortInBytes(byte[] bytes,
int index,
short value) |
static void |
setMemoryAccessor(MemoryAccessor memoryAccessor) |
static <H extends MemoryAccessor & MemorySizeProperties> |
setMemoryHandling(H memoryHandler) |
static void |
setMemoryHandling(MemoryAccessor memoryAccessor,
MemorySizeProperties memorySizeProperties) |
static void |
setObject(Object instance,
long offset,
Object value) |
static ByteBuffer |
setPositionLimit(ByteBuffer buffer,
int position,
int limit) |
static ByteBuffer |
setPositionLimit(ByteBuffer buffer,
long positionLimit) |
static byte[] |
toArray(ByteBuffer source) |
static byte[] |
toArray(ByteBuffer[] sources) |
static byte[] |
toArray(ByteBuffer source,
int position,
int length) |
public static final <H extends MemoryAccessor & MemorySizeProperties> void setMemoryHandling(H memoryHandler)
public static final void setMemoryAccessor(MemoryAccessor memoryAccessor)
public static final void setMemoryHandling(MemoryAccessor memoryAccessor, MemorySizeProperties memorySizeProperties)
public static final MemoryAccessor memoryAccessor()
public static final MemoryAccessor memoryAccessorReversing()
public static final MemorySizeProperties memorySizeProperties()
public static final void guaranteeUsability()
public static final long getDirectByteBufferAddress(ByteBuffer directBuffer)
public static final boolean deallocateDirectByteBuffer(ByteBuffer directBuffer)
public static final boolean isDirectByteBuffer(ByteBuffer byteBuffer)
public static final ByteBuffer guaranteeDirectByteBuffer(ByteBuffer directBuffer)
public static final long allocate(long bytes)
public static final long reallocate(long address,
long bytes)
public static final void free(long address)
public static final void fillMemory(long address,
long length,
byte value)
public static final int defaultBufferSize()
public static final int pageSize()
public static final int byteSizeInstance(Class<?> c)
public static final int byteSizeObjectHeader(Class<?> c)
public static final int byteSizeFieldValue(Field field)
public static final int byteSizeFieldValue(Class<?> type)
public static final long byteSizeArray_byte(long elementCount)
public static final long byteSizeArray_boolean(long elementCount)
public static final long byteSizeArray_short(long elementCount)
public static final long byteSizeArray_char(long elementCount)
public static final long byteSizeArray_int(long elementCount)
public static final long byteSizeArray_float(long elementCount)
public static final long byteSizeArray_long(long elementCount)
public static final long byteSizeArray_double(long elementCount)
public static final long byteSizeArrayObject(long elementCount)
public static final int byteSizePrimitive(Class<?> type)
public static final int bitSize_byte()
public static final int byteSize_byte()
public static final int byteSize_boolean()
public static final int byteSize_short()
public static final int byteSize_char()
public static final int byteSize_int()
public static final int byteSize_float()
public static final int byteSize_long()
public static final int byteSize_double()
public static final int byteSizeReference()
public static final int bitSize_boolean()
public static final int bitSize_short()
public static final int bitSize_char()
public static final int bitSize_int()
public static final int bitSize_float()
public static final int bitSize_long()
public static final int bitSize_double()
public static final long objectFieldOffset(Field field)
public static final long[] objectFieldOffsets(Field[] fields)
public static final byte get_byte(long address)
public static final boolean get_boolean(long address)
public static final short get_short(long address)
public static final char get_char(long address)
public static final int get_int(long address)
public static final float get_float(long address)
public static final long get_long(long address)
public static final double get_double(long address)
public static final byte get_byte(Object instance, long offset)
public static final boolean get_boolean(Object instance, long offset)
public static final short get_short(Object instance, long offset)
public static final char get_char(Object instance, long offset)
public static final int get_int(Object instance, long offset)
public static final float get_float(Object instance, long offset)
public static final long get_long(Object instance, long offset)
public static final double get_double(Object instance, long offset)
public static final void set_byte(long address,
byte value)
public static final void set_boolean(long address,
boolean value)
public static final void set_short(long address,
short value)
public static final void set_char(long address,
char value)
public static final void set_int(long address,
int value)
public static final void set_float(long address,
float value)
public static final void set_long(long address,
long value)
public static final void set_double(long address,
double value)
public static final void set_byte(Object instance, long offset, byte value)
public static final void set_boolean(Object instance, long offset, boolean value)
public static final void set_short(Object instance, long offset, short value)
public static final void set_char(Object instance, long offset, char value)
public static final void set_int(Object instance, long offset, int value)
public static final void set_float(Object instance, long offset, float value)
public static final void set_long(Object instance, long offset, long value)
public static final void set_double(Object instance, long offset, double value)
public static final void set_byteInBytes(byte[] bytes,
int index,
byte value)
public static final void set_booleanInBytes(byte[] bytes,
int index,
boolean value)
public static final void set_shortInBytes(byte[] bytes,
int index,
short value)
public static final void set_charInBytes(byte[] bytes,
int index,
char value)
public static final void set_intInBytes(byte[] bytes,
int index,
int value)
public static final void set_floatInBytes(byte[] bytes,
int index,
float value)
public static final void set_longInBytes(byte[] bytes,
int index,
long value)
public static final void set_doubleInBytes(byte[] bytes,
int index,
double value)
public static final void copyRange(long sourceAddress,
long targetAddress,
long length)
public static final void copyRangeToArray(long sourceAddress,
byte[] target)
public static final void copyRangeToArray(long sourceAddress,
boolean[] target)
public static final void copyRangeToArray(long sourceAddress,
short[] target)
public static final void copyRangeToArray(long sourceAddress,
char[] target)
public static final void copyRangeToArray(long sourceAddress,
int[] target)
public static final void copyRangeToArray(long sourceAddress,
float[] target)
public static final void copyRangeToArray(long sourceAddress,
long[] target)
public static final void copyRangeToArray(long sourceAddress,
double[] target)
public static final void copyArrayToAddress(byte[] array,
long targetAddress)
public static final void copyArrayToAddress(boolean[] array,
long targetAddress)
public static final void copyArrayToAddress(short[] array,
long targetAddress)
public static final void copyArrayToAddress(char[] array,
long targetAddress)
public static final void copyArrayToAddress(int[] array,
long targetAddress)
public static final void copyArrayToAddress(float[] array,
long targetAddress)
public static final void copyArrayToAddress(long[] array,
long targetAddress)
public static final void copyArrayToAddress(double[] array,
long targetAddress)
public static final byte[] asByteArray(long[] longArray)
public static final byte[] asByteArray(long value)
public static final void ensureClassInitialized(Class<?> c)
public static final void ensureClassInitialized(Class<?> c, Iterable<Field> usedFields)
public static final <T> T instantiateBlank(Class<T> c) throws InstantiationRuntimeException
InstantiationRuntimeExceptionpublic static final ByteOrder nativeByteOrder()
public static final boolean isBigEndianNativeOrder()
public static final boolean isLittleEndianNativeOrder()
public static final ByteOrder parseByteOrder(String name)
String instance to a ByteOrder instance according to ByteOrder#toString()
or throws an IllegalArgumentException if the passed string does not match exactely one of the
ByteOrder constant instances' string representation.name - the string representing the ByteOrder instance to be parsed.ByteOrderIllegalArgumentException - if the string can't be recognized as a ByteOrder constant instance.ByteOrder.toString()public static final ByteBuffer allocateDirectNative(int capacity) throws IllegalArgumentException
ByteBuffer.allocateDirect(capacity).order(ByteOrder.nativeOrder()).
See ByteBuffer.allocateDirect(int) for details.capacity - The new buffer's capacity, in bytesIllegalArgumentException - If the capacity is a negative integer.ByteBuffer.allocateDirect(int),
ByteBuffer.order(ByteOrder)public static final ByteBuffer allocateDirectNative(long capacity) throws IllegalArgumentException
IllegalArgumentExceptionpublic static final ByteBuffer allocateDirectNativeDefault()
public static final byte[] toArray(ByteBuffer source)
public static final byte[] toArray(ByteBuffer source, int position, int length)
public static final byte[] toArray(ByteBuffer[] sources)
public static final long getPositionLimit(ByteBuffer buffer)
public static final ByteBuffer setPositionLimit(ByteBuffer buffer, long positionLimit)
public static final ByteBuffer setPositionLimit(ByteBuffer buffer, int position, int limit)
public static final ByteBuffer capLimit(ByteBuffer buffer, long limit)
public static final ByteBuffer clearForLimit(ByteBuffer buffer, long limit)
Copyright © 2022 MicroStream Software. All rights reserved.