This abstracts read/write operations to either a native memory area, or a java ByteBuffer.
| Modifier and Type | Field and Description |
|---|---|
| protected final long | |
| protected final boolean |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public final long | Returns: A long value containing the native memory addressGets the native address of this memory region. |
| public abstract Object | |
| public abstract int | |
| public abstract int | |
| public abstract ByteBuffer | Returns: A ByteBuffer instanceCreates a view of this memory object as a java NIO byte buffer. |
| public abstract MemoryIO | |
| public abstract void | get(long
The offset within the memory area to read the bytes. offset, byte[] The output byte array to place the data. dst, int The offset within the byte array to start copying. off, int The length of data to read. len)Reads an array of bytes from the memory area at the specified offset. |
| public abstract void | get(long
The offset within the memory area to read the shorts. offset, short[] The output array to place the data in. dst, int The offset within the array to start copying. off, int The number of shorts to read. len)Reads an array of shorts from the memory area at the specified offset. |
| public abstract void | get(long
The offset within the memory area to read the ints. offset, int[] The output array to place the data in. dst, int The offset within the array to start copying. off, int The number of ints to read. len)Reads an array of ints from the memory area at the specified offset. |
| public abstract void | get(long
The offset within the memory area to read the longs. offset, long[] The output array to place the data in. dst, int The offset within the array to start copying. off, int The number of longs to read. len)Reads an array of longs from the memory area at the specified offset. |
| public abstract void | get(long
The offset within the memory area to read the floats. offset, float[] The output array to place the data in. dst, int The offset within the array to start copying. off, int The number of floats to read. len)Reads an array of floats from the memory area at the specified offset. |
| public abstract void | get(long
The offset within the memory area to read the doubles. offset, double[] The output array to place the data in. dst, int The offset within the array to start copying. off, int The number of doubles to read. len)Reads an array of doubles from the memory area at the specified offset. |
| public abstract long | Returns: Along value that represents the address.The offset within the memory area to read the value. offset)Reads a pointer value at the specified offset within the memory area. |
| public abstract byte | Returns: The 8 bit integer value read fromoffsetThe offset within the memory area to read the value. offset)Reads an 8 bit integer value from the memory area. |
| public abstract double | Returns: The double value read fromoffsetThe offset within the memory area to read the value. offset)Reads a double value from the memory area. |
| public abstract float | Returns: The float value read fromoffsetThe offset within the memory area to read the value. offset)Reads a float value from the memory area. |
| public abstract int | Returns: The 32 bit integer value read fromoffsetThe offset within the memory area to read the value. offset)Reads a 32 bit integer value from the memory area. |
| public abstract long | Returns: The 64 bit integer value read fromoffsetThe offset within the memory area to read the value. offset)Reads a 64 bit integer value from the memory area. |
| public abstract MemoryIO | Returns: ADirectMemoryIO accessor that can be used to access the memory
pointed to by the address.The offset within the memory area to read the value. offset)Reads a pointer value at the specified offset within the memory area, and wraps it in an abstract memory accessor. |
| public abstract long | Returns: The native long value read fromoffsetThe offset within the memory area to read the value. offset)Reads a native long integer value from the memory area. |
| public abstract short | Returns: The 16 bit integer value read fromoffsetThe offset within the memory area to read the value. offset)Reads a 16 bit integer value from the memory area. |
| public abstract byte[] | Returns: A byte array containing a copy of the data.The offset within the memory area of the start of the string. offset)Reads a zero terminated byte array (e.g. an ascii or utf-8 string) |
| public abstract byte[] | Returns: A byte array containing a copy of the data.The offset within the memory area of the start of the string. offset, int The maximum length to search for the zero byte terminator. maxlen)Reads a zero terminated byte array (e.g. an ascii or utf-8 string) |
| public abstract int | Returns: The index of the value, relative to offset.The offset within the memory area to start searching. offset, byte The value to search for. value)Gets the first index within the memory area of a particular 8 bit value. |
| public abstract int | Returns: The index of the value, relative to offset.The offset within the memory area to start searching. offset, byte The value to search for. value, int maxlen)Gets the first index within the memory area of a particular 8 bit value. |
| public final boolean | Returns: true if the memory area is a native pointer.Checks if the memory area is a native memory pointer. |
| public final boolean | |
| public abstract ByteOrder | |
| public abstract void | put(long
The offset within the memory area to start writing the bytes. offset, byte[] The byte array to write to the memory area. src, int The offset within the byte array to start copying. off, int The length of data to write. len)Writes an array of bytes to the memory area at the specified offset. |
| public abstract void | put(long
The offset within the memory area to start writing the shorts. offset, short[] The array to write to the memory area. src, int The offset within the array to start copying. off, int The number of shorts to write. len)Writes an array of shorts to the memory area at the specified offset. |
| public abstract void | put(long
The offset within the memory area to start writing the ints. offset, int[] The array to write to the memory area. src, int The offset within the array to start copying. off, int The number of ints to write. len)Writes an array of ints to the memory area at the specified offset. |
| public abstract void | put(long
The offset within the memory area to start writing the longs. offset, long[] The array to write to the memory area. src, int The offset within the array to start copying. off, int The number of longs to write. len)Writes an array of longs to the memory area at the specified offset. |
| public abstract void | put(long
The offset within the memory area to start writing the floats. offset, float[] The array to write to the memory area. src, int The offset within the array to start copying. off, int The number of floats to write. len)Writes an array of floats to the memory area at the specified offset. |
| public abstract void | put(long
The offset within the memory area to start writing the doubles. offset, double[] The array to write to the memory area. src, int The offset within the array to start copying. off, int The number of doubles to write. len)Writes an array of doubles to the memory area at the specified offset. |
| public abstract void | putAddress(long
The offset within the memory area to write the value. offset, long The pointer value to write to the memory location. value)Writes a pointer value to the memory area at the specified offset. |
| public abstract void | putByte(long
The offset within the memory area to write the value. offset, byte The 8 bit integer value to write to the memory location. value)Writes an 8 bit integer value to the memory area at the specified offset. |
| public abstract void | putDouble(long
The offset within the memory area to write the value. offset, double The 64 bit float value to write to the memory location. value)Writes a 64 bit float value to the memory area at the specified offset. |
| public abstract void | putFloat(long
The offset within the memory area to write the value. offset, float The 32 bit float value to write to the memory location. value)Writes a 32 bit float value to the memory area at the specified offset. |
| public abstract void | putInt(long
The offset within the memory area to write the value. offset, int The 32 bit integer value to write to the memory location. value)Writes a 32 bit integer value to the memory area at the specified offset. |
| public abstract void | putLong(long
The offset within the memory area to write the value. offset, long The 64 bit integer value to write to the memory location. value)Writes a 64 bit integer value to the memory area at the specified offset. |
| public abstract void | putMemoryIO(long
The offset within the memory area to write the value. offset, MemoryIO The pointer value to write to the memory location. value)Writes a pointer value to the memory area at the specified offset. |
| public abstract void | putNativeLong(long
The offset within the memory area to write the value. offset, long The native long integer value to write to the memory location. value)Writes a native long integer value to the memory area at the specified offset. |
| public abstract void | putShort(long
The offset within the memory area to write the value. offset, short The 16 bit integer value to write to the memory location. value)Writes a 16 bit integer value to the memory area at the specified offset. |
| public abstract void | putZeroTerminatedByteArray(long
The offset within the memory area of the start of the string. offset, byte[] The byte array to write to the memory. bytes, int The offset with the byte array to start copying. off, int The number of bytes of the byte array to write to the memory area. (not including zero byte) len)Writes a byte array to memory, and appends a zero terminator |
| public abstract void | setMemory(long
The offset within the memory area to start writing. offset, long The number of bytes to set to the value. size, byte The value to set each byte to. value)Sets the contents of the memory area to the value. |
| public abstract MemoryIO | Returns: AMemoryIO instance.The offset within the existing memory area to start the
new offset)MemoryIO at.Creates a new MemoryIO pointing to a subset of the memory area of this
|
| public abstract MemoryIO | Returns: AMemoryIO instance.The offset within the existing memory area to start the
new offset, long MemoryIO at.The size of the new slice. size)Creates a new MemoryIO pointing to a subset of the memory area of this
|
| address | back to summary |
|---|---|
| protected final long address | |
| isDirect | back to summary |
|---|---|
| protected final boolean isDirect | |
| MemoryIO | back to summary |
|---|---|
| protected MemoryIO(boolean direct, long address) | |
| address | back to summary |
|---|---|
| public final long address() Gets the native address of this memory region. May return NULL (0) if this is not a direct pointer.
| |
| array | back to summary |
|---|---|
| public abstract Object array() | |
| arrayLength | back to summary |
|---|---|
| public abstract int arrayLength() | |
| arrayOffset | back to summary |
|---|---|
| public abstract int arrayOffset() | |
| asByteBuffer | back to summary |
|---|---|
| public abstract ByteBuffer asByteBuffer() Creates a view of this memory object as a java NIO byte buffer.
| |
| dup | back to summary |
|---|---|
| public abstract MemoryIO dup() Duplicates this
| |
| get | back to summary |
|---|---|
| public abstract void get(long offset, byte[] dst, int off, int len) Reads an array of bytes from the memory area at the specified offset.
| |
| get | back to summary |
|---|---|
| public abstract void get(long offset, short[] dst, int off, int len) Reads an array of shorts from the memory area at the specified offset.
| |
| get | back to summary |
|---|---|
| public abstract void get(long offset, int[] dst, int off, int len) Reads an array of ints from the memory area at the specified offset.
| |
| get | back to summary |
|---|---|
| public abstract void get(long offset, long[] dst, int off, int len) Reads an array of longs from the memory area at the specified offset.
| |
| get | back to summary |
|---|---|
| public abstract void get(long offset, float[] dst, int off, int len) Reads an array of floats from the memory area at the specified offset.
| |
| get | back to summary |
|---|---|
| public abstract void get(long offset, double[] dst, int off, int len) Reads an array of doubles from the memory area at the specified offset.
| |
| getAddress | back to summary |
|---|---|
| public abstract long getAddress(long offset) Reads a pointer value at the specified offset within the memory area.
| |
| getByte | back to summary |
|---|---|
| public abstract byte getByte(long offset) Reads an 8 bit integer value from the memory area.
| |
| getDouble | back to summary |
|---|---|
| public abstract double getDouble(long offset) Reads a double value from the memory area.
| |
| getFloat | back to summary |
|---|---|
| public abstract float getFloat(long offset) Reads a float value from the memory area.
| |
| getInt | back to summary |
|---|---|
| public abstract int getInt(long offset) Reads a 32 bit integer value from the memory area.
| |
| getLong | back to summary |
|---|---|
| public abstract long getLong(long offset) Reads a 64 bit integer value from the memory area.
| |
| getMemoryIO | back to summary |
|---|---|
| public abstract MemoryIO getMemoryIO(long offset) Reads a pointer value at the specified offset within the memory area, and wraps it in an abstract memory accessor.
| |
| getNativeLong | back to summary |
|---|---|
| public abstract long getNativeLong(long offset) Reads a native long integer value from the memory area. A native long is 32bits on either ILP32 or LLP64 architectures, and 64 bits on an LP64 architecture. This means that it will always read a 32bit value on Windows, but on Unix systems such as MacOS or Linux, it will read a 32bit value on 32bit systems, and a 64bit value on 64bit systems.
| |
| getShort | back to summary |
|---|---|
| public abstract short getShort(long offset) Reads a 16 bit integer value from the memory area.
| |
| getZeroTerminatedByteArray | back to summary |
|---|---|
| public abstract byte[] getZeroTerminatedByteArray(long offset) Reads a zero terminated byte array (e.g. an ascii or utf-8 string)
| |
| getZeroTerminatedByteArray | back to summary |
|---|---|
| public abstract byte[] getZeroTerminatedByteArray(long offset, int maxlen) Reads a zero terminated byte array (e.g. an ascii or utf-8 string)
| |
| indexOf | back to summary |
|---|---|
| public abstract int indexOf(long offset, byte value) Gets the first index within the memory area of a particular 8 bit value.
| |
| indexOf | back to summary |
|---|---|
| public abstract int indexOf(long offset, byte value, int maxlen) Gets the first index within the memory area of a particular 8 bit value.
| |
| isDirect | back to summary |
|---|---|
| public final boolean isDirect() Checks if the memory area is a native memory pointer.
| |
| isNull | back to summary |
|---|---|
| public final boolean isNull() Checks if the memory area is NULL.
| |
| order | back to summary |
|---|---|
| public abstract ByteOrder order() Gets the
| |
| put | back to summary |
|---|---|
| public abstract void put(long offset, byte[] src, int off, int len) Writes an array of bytes to the memory area at the specified offset.
| |
| put | back to summary |
|---|---|
| public abstract void put(long offset, short[] src, int off, int len) Writes an array of shorts to the memory area at the specified offset.
| |
| put | back to summary |
|---|---|
| public abstract void put(long offset, int[] src, int off, int len) Writes an array of ints to the memory area at the specified offset.
| |
| put | back to summary |
|---|---|
| public abstract void put(long offset, long[] src, int off, int len) Writes an array of longs to the memory area at the specified offset.
| |
| put | back to summary |
|---|---|
| public abstract void put(long offset, float[] src, int off, int len) Writes an array of floats to the memory area at the specified offset.
| |
| put | back to summary |
|---|---|
| public abstract void put(long offset, double[] src, int off, int len) Writes an array of doubles to the memory area at the specified offset.
| |
| putAddress | back to summary |
|---|---|
| public abstract void putAddress(long offset, long value) Writes a pointer value to the memory area at the specified offset.
| |
| putByte | back to summary |
|---|---|
| public abstract void putByte(long offset, byte value) Writes an 8 bit integer value to the memory area at the specified offset.
| |
| putDouble | back to summary |
|---|---|
| public abstract void putDouble(long offset, double value) Writes a 64 bit float value to the memory area at the specified offset.
| |
| putFloat | back to summary |
|---|---|
| public abstract void putFloat(long offset, float value) Writes a 32 bit float value to the memory area at the specified offset.
| |
| putInt | back to summary |
|---|---|
| public abstract void putInt(long offset, int value) Writes a 32 bit integer value to the memory area at the specified offset.
| |
| putLong | back to summary |
|---|---|
| public abstract void putLong(long offset, long value) Writes a 64 bit integer value to the memory area at the specified offset.
| |
| putMemoryIO | back to summary |
|---|---|
| public abstract void putMemoryIO(long offset, MemoryIO value) Writes a pointer value to the memory area at the specified offset.
| |
| putNativeLong | back to summary |
|---|---|
| public abstract void putNativeLong(long offset, long value) Writes a native long integer value to the memory area at the specified offset.
| |
| putShort | back to summary |
|---|---|
| public abstract void putShort(long offset, short value) Writes a 16 bit integer value to the memory area at the specified offset.
| |
| putZeroTerminatedByteArray | back to summary |
|---|---|
| public abstract void putZeroTerminatedByteArray(long offset, byte[] bytes, int off, int len) Writes a byte array to memory, and appends a zero terminator
| |
| setMemory | back to summary |
|---|---|
| public abstract void setMemory(long offset, long size, byte value) Sets the contents of the memory area to the value.
| |
| slice | back to summary |
|---|---|
| public abstract MemoryIO slice(long offset) Creates a new MemoryIO pointing to a subset of the memory area of this
| |
| slice | back to summary |
|---|---|
| public abstract MemoryIO slice(long offset, long size) Creates a new MemoryIO pointing to a subset of the memory area of this
| |