MemoryIO using sun.misc.Unsafe
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | UnsafeMemoryIO.UnsafeMemoryIO32
A 32 bit optimized implementation of |
| pack-priv static class | UnsafeMemoryIO.UnsafeMemoryIO64
A 64 bit optimized implementation of |
| Modifier and Type | Field and Description |
|---|---|
| protected static Unsafe |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final void | _copyMemory(long
The source memory address. src, long The destination memory address. dst, long The number of bytes to copy. size)Implements abstract com. |
| public final byte | getByte(long
The memory location to get the value from. address)Implements abstract com. |
| public final void | getByteArray(long
The native memory address to copy the array from. address, byte[] The java array to copy. data, int The offset within the array to start copying to. offset, int The number of array elements to copy. length)Implements abstract com. |
| public final void | getCharArray(long
The native memory address to copy the array from. address, char[] The java array to copy. data, int The offset within the array to start copying to. offset, int The number of array elements to copy. length)Implements abstract com. |
| public final double | getDouble(long
The memory location to get the value from. address)Implements abstract com. |
| public final void | getDoubleArray(long
The native memory address to copy the array from. address, double[] The java array to copy. data, int The offset within the array to start copying to. offset, int The number of array elements to copy. length)Implements abstract com. |
| public final float | getFloat(long
The memory location to get the value from. address)Implements abstract com. |
| public final void | getFloatArray(long
The native memory address to copy the array from. address, float[] The java array to copy. data, int The offset within the array to start copying to. offset, int The number of array elements to copy. length)Implements abstract com. |
| public final int | getInt(long
The memory location to get the value from. address)Implements abstract com. |
| public final void | getIntArray(long
The native memory address to copy the array from. address, int[] The java array to copy. data, int The offset within the array to start copying to. offset, int The number of array elements to copy. length)Implements abstract com. |
| public final long | getLong(long
The memory location to get the value from. address)Implements abstract com. |
| public final void | getLongArray(long
The native memory address to copy the array from. address, long[] The java array to copy. data, int The offset within the array to start copying to. offset, int The number of array elements to copy. length)Implements abstract com. |
| public final short | getShort(long
The memory location to get the value from. address)Implements abstract com. |
| public final void | getShortArray(long
The native memory address to copy the array from. address, short[] The java array to copy. data, int The offset within the array to start copying to. offset, int The number of array elements to copy. length)Implements abstract com. |
| public final long | getStringLength(long
The native address of the string. address)Implements abstract com. |
| private static Object | |
| public final byte[] | getZeroTerminatedByteArray(long
The address to read the data from. address)Implements abstract com. |
| public final byte[] | getZeroTerminatedByteArray(long
The address to read the data from. address, int The limit of the memory area to scan for a zero byte. maxlen)Implements abstract com. |
| public final long | memchr(long
The native memory address to start searching. address, int The value to search for. value, long The size of the native memory region being searched. size)Implements abstract com. |
| public final void | memcpy(long
The destination memory address. dst, long The source memory address. src, long The number of bytes to copy. size)Implements abstract com. |
| public final void | memmove(long
The destination memory address. dst, long The source memory address. src, long The number of bytes to copy. size)Implements abstract com. |
| public final void | putByte(long
The memory location to put the value. address, byte The value to write to memory. value)Implements abstract com. |
| public final void | putByteArray(long
The native memory address to copy the array to. address, byte[] The java array to copy. data, int The offset within the array to start copying from. offset, int The number of array elements to copy. length)Implements abstract com. |
| public final void | putCharArray(long
The native memory address to copy the array to. address, char[] The java array to copy. data, int The offset within the array to start copying from. offset, int The number of array elements to copy. length)Implements abstract com. |
| public final void | putDouble(long
The memory location to put the value. address, double The value to write to memory. value)Implements abstract com. |
| public final void | putDoubleArray(long
The native memory address to copy the array to. address, double[] The java array to copy. data, int The offset within the array to start copying from. offset, int The number of array elements to copy. length)Implements abstract com. |
| public final void | putFloat(long
The memory location to put the value. address, float The value to write to memory. value)Implements abstract com. |
| public final void | putFloatArray(long
The native memory address to copy the array to. address, float[] The java array to copy. data, int The offset within the array to start copying from. offset, int The number of array elements to copy. length)Implements abstract com. |
| public final void | putInt(long
The memory location to put the value. address, int The value to write to memory. value)Implements abstract com. |
| public final void | putIntArray(long
The native memory address to copy the array to. address, int[] The java array to copy. data, int The offset within the array to start copying from. offset, int The number of array elements to copy. length)Implements abstract com. |
| public final void | putLong(long
The memory location to put the value. address, long The value to write to memory. value)Implements abstract com. |
| public final void | putLongArray(long
The native memory address to copy the array to. address, long[] The java array to copy. data, int The offset within the array to start copying from. offset, int The number of array elements to copy. length)Implements abstract com. |
| public final void | putShort(long
The memory location to put the value. address, short The value to write to memory. value)Implements abstract com. |
| public final void | putShortArray(long
The native memory address to copy the array to. address, short[] The java array to copy. data, int The offset within the array to start copying from. offset, int The number of array elements to copy. length)Implements abstract com. |
| public final void | putZeroTerminatedByteArray(long
The address to copy to. address, byte[] The byte array to copy to native memory data, int The offset within the byte array to begin copying from offset, int The number of bytes to copy to native memory length)Implements abstract com. Note A total of length + 1 bytes is written to native memory. |
| public final void | setMemory(long
The address of start of the native memory. src, long The number of bytes to set. size, byte The value to set the native memory to. value)Implements abstract com. |
| unsafe | back to summary |
|---|---|
| protected static Unsafe unsafe | |
| UnsafeMemoryIO | back to summary |
|---|---|
| public UnsafeMemoryIO() | |
| _copyMemory | back to summary |
|---|---|
| public final void _copyMemory(long src, long dst, long size) Implements abstract com. Doc from com. Copies contents of a native memory location to another native memory location.
| |
| getByte | back to summary |
|---|---|
| public final byte getByte(long address) Implements abstract com. Doc from com. Reads an 8 bit integer from a native memory location.
| |
| getByteArray | back to summary |
|---|---|
| public final void getByteArray(long address, byte[] data, int offset, int length) Implements abstract com. Doc from com. Reads a java byte array from native memory.
| |
| getCharArray | back to summary |
|---|---|
| public final void getCharArray(long address, char[] data, int offset, int length) Implements abstract com. Doc from com. Reads a java char array from native memory.
| |
| getDouble | back to summary |
|---|---|
| public final double getDouble(long address) Implements abstract com. Doc from com. Reads a 64 bit floating point value from a native memory location.
| |
| getDoubleArray | back to summary |
|---|---|
| public final void getDoubleArray(long address, double[] data, int offset, int length) Implements abstract com. Doc from com. Reads a java double array from native memory.
| |
| getFloat | back to summary |
|---|---|
| public final float getFloat(long address) Implements abstract com. Doc from com. Reads a 32 bit floating point value from a native memory location.
| |
| getFloatArray | back to summary |
|---|---|
| public final void getFloatArray(long address, float[] data, int offset, int length) Implements abstract com. Doc from com. Reads a java float array from native memory.
| |
| getInt | back to summary |
|---|---|
| public final int getInt(long address) Implements abstract com. Doc from com. Reads a 32 bit integer from a native memory location.
| |
| getIntArray | back to summary |
|---|---|
| public final void getIntArray(long address, int[] data, int offset, int length) Implements abstract com. Doc from com. Reads a java int array from native memory.
| |
| getLong | back to summary |
|---|---|
| public final long getLong(long address) Implements abstract com. Doc from com. Reads a 64 bit integer from a native memory location.
| |
| getLongArray | back to summary |
|---|---|
| public final void getLongArray(long address, long[] data, int offset, int length) Implements abstract com. Doc from com. Reads a java long array from native memory.
| |
| getShort | back to summary |
|---|---|
| public final short getShort(long address) Implements abstract com. Doc from com. Reads a 16 bit integer from a native memory location.
| |
| getShortArray | back to summary |
|---|---|
| public final void getShortArray(long address, short[] data, int offset, int length) Implements abstract com. Doc from com. Reads a java short array from native memory.
| |
| getStringLength | back to summary |
|---|---|
| public final long getStringLength(long address) Implements abstract com. Doc from com. Gets the length of a native ascii or utf-8 string.
| |
| getUnsafe | back to summary |
|---|---|
| private static Object getUnsafe() | |
| getZeroTerminatedByteArray | back to summary |
|---|---|
| public final byte[] getZeroTerminatedByteArray(long address) Implements abstract com. Doc from com. Reads a byte array from native memory, stopping when a zero byte is found. This can be used to read ascii or utf-8 strings from native memory.
| |
| getZeroTerminatedByteArray | back to summary |
|---|---|
| public final byte[] getZeroTerminatedByteArray(long address, int maxlen) Implements abstract com. Doc from com. Reads a byte array from native memory, stopping when a zero byte is found, or the maximum length is reached. This can be used to read ascii or utf-8 strings from native memory.
| |
| memchr | back to summary |
|---|---|
| public final long memchr(long address, int value, long size) Implements abstract com. Doc from com. Gets the address of a byte value in a native memory region.
| |
| memcpy | back to summary |
|---|---|
| public final void memcpy(long dst, long src, long size) Implements abstract com. Doc from com. Copies bytes from one memory location to another. The memory areas
| |
| memmove | back to summary |
|---|---|
| public final void memmove(long dst, long src, long size) Implements abstract com. Doc from com. Copies potentially overlapping memory areas.
| |
| putByte | back to summary |
|---|---|
| public final void putByte(long address, byte value) Implements abstract com. Doc from com. Writes an 8 bit integer value to a native memory location.
| |
| putByteArray | back to summary |
|---|---|
| public final void putByteArray(long address, byte[] data, int offset, int length) Implements abstract com. Doc from com. Writes a java byte array to native memory.
| |
| putCharArray | back to summary |
|---|---|
| public final void putCharArray(long address, char[] data, int offset, int length) Implements abstract com. Doc from com. Writes a java char array to native memory.
| |
| putDouble | back to summary |
|---|---|
| public final void putDouble(long address, double value) Implements abstract com. Doc from com. Writes a 64 bit floating point value to a native memory location.
| |
| putDoubleArray | back to summary |
|---|---|
| public final void putDoubleArray(long address, double[] data, int offset, int length) Implements abstract com. Doc from com. Writes a java double array to native memory.
| |
| putFloat | back to summary |
|---|---|
| public final void putFloat(long address, float value) Implements abstract com. Doc from com. Writes a 32 bit floating point value to a native memory location.
| |
| putFloatArray | back to summary |
|---|---|
| public final void putFloatArray(long address, float[] data, int offset, int length) Implements abstract com. Doc from com. Writes a java double array to native memory.
| |
| putInt | back to summary |
|---|---|
| public final void putInt(long address, int value) Implements abstract com. Doc from com. Writes a 32 bit integer value to a native memory location.
| |
| putIntArray | back to summary |
|---|---|
| public final void putIntArray(long address, int[] data, int offset, int length) Implements abstract com. Doc from com. Writes a java int array to native memory.
| |
| putLong | back to summary |
|---|---|
| public final void putLong(long address, long value) Implements abstract com. Doc from com. Writes a 64 bit integer value to a native memory location.
| |
| putLongArray | back to summary |
|---|---|
| public final void putLongArray(long address, long[] data, int offset, int length) Implements abstract com. Doc from com. Writes a java long array to native memory.
| |
| putShort | back to summary |
|---|---|
| public final void putShort(long address, short value) Implements abstract com. Doc from com. Writes a 16 bit integer value to a native memory location.
| |
| putShortArray | back to summary |
|---|---|
| public final void putShortArray(long address, short[] data, int offset, int length) Implements abstract com. Doc from com. Writes a java short array to native memory.
| |
| putZeroTerminatedByteArray | back to summary |
|---|---|
| public final void putZeroTerminatedByteArray(long address, byte[] data, int offset, int length) Implements abstract com. Doc from com. Copies a java byte array to native memory and appends a NUL terminating byte Note A total of length + 1 bytes is written to native memory.
| |
| setMemory | back to summary |
|---|---|
| public final void setMemory(long src, long size, byte value) Implements abstract com. Doc from com. Sets a region of native memory to a specific byte value.
| |
MemoryIO using sun.misc.Unsafe
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public final long | getAddress(long
The memory location to get the value from. address)Implements abstract com. |
| public final void | putAddress(long
The memory location to put the value. address, long The value to write to memory. value)Implements abstract com. |
| UnsafeMemoryIO32 | back to summary |
|---|---|
| pack-priv UnsafeMemoryIO32() | |
| getAddress | back to summary |
|---|---|
| public final long getAddress(long address) Implements abstract com. Doc from com. Reads a native memory address from a native memory location.
| |
| putAddress | back to summary |
|---|---|
| public final void putAddress(long address, long value) Implements abstract com. Doc from com. Writes a native memory address value to a native memory location.
| |
MemoryIO using sun.misc.Unsafe
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public final long | getAddress(long
The memory location to get the value from. address)Implements abstract com. |
| public final void | putAddress(long
The memory location to put the value. address, long The value to write to memory. value)Implements abstract com. |
| UnsafeMemoryIO64 | back to summary |
|---|---|
| pack-priv UnsafeMemoryIO64() | |
| getAddress | back to summary |
|---|---|
| public final long getAddress(long address) Implements abstract com. Doc from com. Reads a native memory address from a native memory location.
| |
| putAddress | back to summary |
|---|---|
| public final void putAddress(long address, long value) Implements abstract com. Doc from com. Writes a native memory address value to a native memory location.
| |