| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class | |
| private abstract static class | MemoryIO.
An implementation of MemoryIO using JNI methods. |
| private static class | MemoryIO.
A 32 bit optimized implementation of |
| private static class | MemoryIO.
A 64 bit optimized implementation of |
| private static class | MemoryIO.
Holds a single instance of |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final long | ADDRESS_MASK
The address mask used to truncate 32bit addresses contained in long values |
| pack-priv final Foreign | foreign
A handle to the JNI accessor |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv abstract void | _copyMemory(long
The source memory address. src, long The destination memory address. dst, long The number of bytes to copy. size)Copies contents of a native memory location to another native memory location. |
| public final long | Returns: The native address of the allocated memory.The number of bytes of memory to allocate size, boolean Whether the memory should be cleared (each byte set to zero). clear)Allocates native memory. |
| public final void | copyMemory(long
The source memory address. src, long The destination memory address. dst, long The number of bytes to copy. size)Copies contents of a native memory location to another native memory location. |
| public final void | freeMemory(long
The address of the memory to release. address)Releases memory allocated via |
| public abstract long | Returns: A long containing the value.The memory location to get the value from. address)Reads a native memory address from a native memory location. |
| public abstract byte | Returns: A byte containing the value.The memory location to get the value from. address)Reads an 8 bit integer from a native memory location. |
| public abstract 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)Reads a java byte array from native memory. |
| public abstract 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)Reads a java char array from native memory. |
| public static MemoryIO | |
| public final long | Returns: The native memory address of the buffer contents, or null if not a direct buffer.A direct ByteBuffer to get the address of. buffer)Gets the native memory address of a direct ByteBuffer |
| public abstract double | Returns: A double containing the value.The memory location to get the value from. address)Reads a 64 bit floating point value from a native memory location. |
| public abstract 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)Reads a java double array from native memory. |
| public abstract float | Returns: A float containing the value.The memory location to get the value from. address)Reads a 32 bit floating point value from a native memory location. |
| public abstract 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)Reads a java float array from native memory. |
| public static MemoryIO | Returns: AMemoryIO instance.Gets an instance of |
| public abstract int | Returns: An int containing the value.The memory location to get the value from. address)Reads a 32 bit integer from a native memory location. |
| public abstract 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)Reads a java int array from native memory. |
| public abstract long | Returns: A long containing the value.The memory location to get the value from. address)Reads a 64 bit integer from a native memory location. |
| public abstract 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)Reads a java long array from native memory. |
| public abstract short | Returns: A short containing the value.The memory location to get the value from. address)Reads a 16 bit integer from a native memory location. |
| public abstract 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)Reads a java short array from native memory. |
| public abstract long | Returns: The length of the string, in bytes.The native address of the string. address)Gets the length of a native ascii or utf-8 string. |
| public abstract byte[] | Returns: The byte array containing a copy of the native data. Any zero byte is stripped from the end.The address to read the data from. address)Reads a byte array from native memory, stopping when a zero byte is found. |
| public abstract byte[] | Returns: The byte array containing a copy of the native data. Any zero byte is stripped from the end.The address to read the data from. address, int The limit of the memory area to scan for a zero byte. maxlen)Reads a byte array from native memory, stopping when a zero byte is found, or the maximum length is reached. |
| public final byte[] | |
| public final long | Returns: The offset from the memory address of the value, if found, else -1 (minus one).The native memory address to start searching from. address, byte The value to search for. value)Finds the location of a byte value in a native memory region. |
| public final long | Returns: The offset from the memory address of the value, if found, else -1 (minus one).The native memory address to start searching from. address, byte The value to search for. value, int The maximum number of bytes to search. maxlen)Finds the location of a byte value in a native memory region. |
| pack-priv static boolean | Returns: true if sun.misc.Unsafe is available and usableDetermines the best Unsafe implementation to use. |
| public abstract long | Returns: The address of the value, or 0 (zero) if not found.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)Gets the address of a byte value in a native memory region. |
| public abstract void | memcpy(long
The destination memory address. dst, long The source memory address. src, long The number of bytes to copy. size)Copies bytes from one memory location to another. |
| public abstract void | memmove(long
The destination memory address. dst, long The source memory address. src, long The number of bytes to copy. size)Copies potentially overlapping memory areas. |
| public final void | memset(long
The address of start of the native memory. address, int The value to set the native memory to. value, long The number of bytes to set. size)Sets a region of native memory to a specific byte value. |
| public final ByteBuffer | Returns: A ByteBuffer representing the native memory region.The start of the native memory region. address, int The size of the native memory region. capacity)Creates a new Direct ByteBuffer for a native memory region. |
| private static MemoryIO | Returns: An instance ofMemoryIOCreates a new instance of |
| private static MemoryIO | |
| private static MemoryIO | |
| private static MemoryIO | Returns: An instance ofMemoryIOCreates a new JNI implementation of |
| private static MemoryIO | Returns: An instance ofMemoryIOCreates a new JNI implementation of |
| private static MemoryIO | Returns: An instance ofMemoryIOCreates a new sun.misc.Unsafe implementation of |
| private static MemoryIO | Returns: An instance ofMemoryIOCreates a new sun.misc.Unsafe implementation of |
| private static MemoryIO | Returns: An instance ofMemoryIOCreates a new sun.misc.Unsafe implementation of |
| public abstract void | putAddress(long
The memory location to put the value. address, long The value to write to memory. value)Writes a native memory address value to a native memory location. |
| public abstract void | putByte(long
The memory location to put the value. address, byte The value to write to memory. value)Writes an 8 bit integer value to a native memory location. |
| public abstract 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)Writes a java byte array to native memory. |
| public abstract 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)Writes a java char array to native memory. |
| public abstract void | putDouble(long
The memory location to put the value. address, double The value to write to memory. value)Writes a 64 bit floating point value to a native memory location. |
| public abstract 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)Writes a java double array to native memory. |
| public abstract void | putFloat(long
The memory location to put the value. address, float The value to write to memory. value)Writes a 32 bit floating point value to a native memory location. |
| public abstract 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)Writes a java double array to native memory. |
| public abstract void | putInt(long
The memory location to put the value. address, int The value to write to memory. value)Writes a 32 bit integer value to a native memory location. |
| public abstract 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)Writes a java int array to native memory. |
| public abstract void | putLong(long
The memory location to put the value. address, long The value to write to memory. value)Writes a 64 bit integer value to a native memory location. |
| public abstract 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)Writes a java long array to native memory. |
| public abstract void | putShort(long
The memory location to put the value. address, short The value to write to memory. value)Writes a 16 bit integer value to a native memory location. |
| public abstract 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)Writes a java short array to native memory. |
| public abstract 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)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. |
| public abstract void | setMemory(long
The address of start of the native memory. address, long The number of bytes to set. size, byte The value to set the native memory to. value)Sets a region of native memory to a specific byte value. |
| private static void | verifyAccessor(Class<T>
The class of sun.misc.Unsafe unsafeClass, Class<T> The class of the primitive type. primitive)Verifies that there is are accessor functions (get,put) for a particular primitive type in the sun.misc.Unsafe class. |