Pointerinstances will represent direct
memory (that is, a fixed address in the process address space, directly accessible by native code), however,
it is possible to wrap a java byte array in a Pointerinstance to pass to a native function
as a memory address. See isDirect() for more information.
| Modifier and Type | Field and Description |
|---|---|
| private final long | |
| private final boolean | |
| private final Runtime |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public final long | Returns: the native address of this memory object. If this object is not a native memory address, an address of zero is returned.Gets the native address of this memory object (optional operation). |
| public abstract Object | |
| public abstract int | Returns: The length of the backing array usedReturns the length of this pointer's backing array that is used by this pointer. |
| public abstract int | Returns: The offset of the first element on the backing arrayReturns the offset within this pointer's backing array of the first element. |
| public abstract void | checkBounds(long
the starting point within this memory region. offset, long the length of the memory region in bytes length)Checks that the memory region is within the bounds of this memory object |
| public abstract void | get(long
the offset from the start of the memory this offset, byte[] Pointer represents at which the first value will be read.the array into which values are to be stored. dst, int the start index in the idx, int dst array to begin storing the values.the number of values to be read. len)Bulk get method for multiple |
| public abstract void | get(long
The offset from the start of the memory this offset, short[] Pointer represents at which the first value will be read.The array into which values are to be stored. dst, int the start index in the idx, int dst array to begin storing the values.the number of values to be read. len)Bulk get method for multiple |
| public abstract void | get(long
The offset from the start of the memory this offset, int[] Pointer represents at which the first value will be read.The array into which values are to be stored. dst, int the start index in the idx, int dst array to begin storing the values.the number of values to be read. len)Bulk get method for multiple |
| public abstract void | get(long
The offset from the start of the memory this offset, long[] Pointer represents at which the first value will be read.The array into which values are to be stored. dst, int the start index in the idx, int dst array to begin storing the values.the number of values to be read. len)Bulk get method for multiple |
| public abstract void | get(long
The offset from the start of the memory this offset, float[] Pointer represents at which the first value will be read.The array into which values are to be stored. dst, int the start index in the idx, int dst array to begin storing the values.the number of values to be read. len)Bulk get method for multiple |
| public abstract void | get(long
The offset from the start of the memory this offset, double[] Pointer represents at which the first value will be read.The array into which values are to be stored. dst, int the start index in the idx, int dst array to begin storing the values.the number of values to be read. len)Bulk get method for multiple |
| public void | get(long
The offset from the start of the memory this offset, Pointer[] Pointer represents at which the first value will be read.The array into which values are to be stored. dst, int the start index in the idx, int dst array to begin storing the values.the number of values to be read. len)Bulk get method for multiple |
| public abstract long | Returns: the native address value contained in the memory at the offsetThe offset from the start of the memory this offset)Pointer represents at which the value will be read.Reads a native memory address value at the given offset. |
| public abstract byte | Returns: thebyte value at the offset.The offset from the start of the memory this offset)Pointer represents at which the value will be read.Reads an |
| public abstract double | Returns: thedouble value at the offset.The offset from the start of the memory this offset)Pointer represents at which the value will be read.Reads a |
| public abstract float | Returns: thefloat value at the offset.The offset from the start of the memory this offset)Pointer represents at which the value will be read.Reads a |
| public abstract int | Returns: theint value contained in the memory at the offset.The offset from the start of the memory this offset)Pointer represents at which the value will be read.Reads an |
| public abstract long | |
| public abstract long | Returns: thelong value at the offset.The offset from the start of the memory this offset)Pointer represents at which the value will be read.Reads a |
| public abstract long | Returns: thelong value at the offset.The offset from the start of the memory this offset)Pointer represents at which the value will be read.Reads a |
| public abstract long | Returns: the nativelong value at the offset.The offset from the start of the memory this offset)Pointer represents at which the value will be read.Reads a native |
| public Pointer[] | |
| public String[] | |
| public abstract Pointer | Returns: thePointer value read from memory.the offset from the start of the memory this offset)Pointer represents at which the value will be read.Reads an |
| public abstract Pointer | Returns: thePointer value read from memory.the offset from the start of the memory this offset, long Pointer represents at which the value will be read.the maximum size of the memory location the returned size)Pointer represents.Reads an |
| public final Runtime | Returns: theRuntime instance of this Pointer.Gets the |
| public abstract short | Returns: theshort value at the offset.The offset from the start of the memory this offset)Pointer represents at which the value will be read.Reads a |
| public abstract String | Returns: theString value read from memory.the offset from the start of the memory this offset)Pointer represents at which the value will be read.Reads an |
| public abstract String | Returns: theString value read from memory.the offset from the start of the memory this offset, int Pointer represents at which the value will be read.the maximum size of memory to search for a NUL byte. maxLength, Charset the cs)Charset to use to decode the string.Reads a |
| public abstract boolean | Returns: true if, and only if, this memory object is backed by an arrayIndicates whether this |
| public abstract int | Returns: the offset from the start of the search area (i.e. relative to the offset parameter), or -1 if not found.the offset from the start of the memory location this offset, byte Pointer represents to begin searching.the value)byte value to locate.Returns the location of a byte value within the memory area represented by this |
| public abstract int | Returns: the offset from the start of the search area (i.e. relative to the offset parameter), or -1 if not found.the offset from the start of the memory location this offset, byte Pointer represents to begin searching.the value, int byte value to locate.the maximum number of bytes to search for the desired value. maxlen)Returns the location of a byte value within the memory area represented by this |
| public final boolean | Returns: true if, and only if, this memory object represents a native address.Indicates whether or not this memory object represents a native memory address. |
| public static Pointer | Returns: aPointer instance.the runtime, long Runtime of the pointer.the address)address to wrap in a Pointer instance.Wraps an integer value in an opaque |
| public abstract void | put(long
the offset from the start of the memory this offset, byte[] Pointer represents at which the first value will be written.the array to get values from. src, int the start index in the idx, int dst array to begin reading values.the number of values to be written. len)Bulk put method for multiple |
| public abstract void | put(long
the offset from the start of the memory this offset, short[] Pointer represents at which the first value will be written.the array to get values from. src, int the start index in the idx, int dst array to begin reading values.the number of values to be written. len)Bulk put method for multiple |
| public abstract void | put(long
the offset from the start of the memory this offset, int[] Pointer represents at which the first value will be written.the array to get values from. src, int the start index in the idx, int dst array to begin reading values.the number of values to be written. len)Bulk put method for multiple |
| public abstract void | put(long
the offset from the start of the memory this offset, long[] Pointer represents at which the first value will be written.the array to get values from. src, int the start index in the idx, int dst array to begin reading values.the number of values to be written. len)Bulk put method for multiple |
| public abstract void | put(long
the offset from the start of the memory this offset, float[] Pointer represents at which the first value will be written.the array to get values from. src, int the start index in the idx, int dst array to begin reading values.the number of values to be written. len)Bulk put method for multiple |
| public abstract void | put(long
the offset from the start of the memory this offset, double[] Pointer represents at which the first value will be written.the array to get values from. src, int the start index in the idx, int dst array to begin reading values.the number of values to be written. len)Bulk put method for multiple |
| public void | put(long
the offset from the start of the memory this offset, Pointer[] Pointer represents at which the first value will be written.the array to get values from. src, int the start index in the idx, int src array to begin reading values.the number of values to be written. len)Bulk put method for multiple |
| public abstract void | putAddress(long
The offset from the start of the memory this offset, long Pointer represents at which the value will be written.The native address value to be written. value)Writes a native memory address value at the given offset. |
| public abstract void | putAddress(long
The offset from the start of the memory this offset, Address Pointer represents at which the value will be written.The native address value to be written. value)Writes a native memory address value at the given offset. |
| public abstract void | putByte(long
The offset from the start of the memory this offset, byte Pointer represents at which the value will be written.the value)byte value to be written.Writes a |
| public abstract void | putDouble(long
The offset from the start of the memory this offset, double Pointer represents at which the value will be written.the value)double value to be written.Writes a |
| public abstract void | putFloat(long
The offset from the start of the memory this offset, float Pointer represents at which the value will be written.the value)float value to be written.Writes a |
| public abstract void | putInt(long
The offset from the start of the memory this offset, int Pointer represents at which the value will be written.the value)int value to be written.Writes an |
| public abstract void | |
| public abstract void | putLong(long
The offset from the start of the memory this offset, long Pointer represents at which the value will be written.the value)long value to be written.Writes a |
| public abstract void | putLongLong(long
The offset from the start of the memory this offset, long Pointer represents at which the value will be written.the value)long value to be written.Writes a |
| public abstract void | putNativeLong(long
The offset from the start of the memory this offset, long Pointer represents at which the value will be written.the native value)long value to be written.Writes a native |
| public abstract void | putPointer(long
The offset from the start of the memory this offset, Pointer Pointer represents at which the value will be written.the value)Pointer value to be written to memory.Writes a |
| public abstract void | putShort(long
The offset from the start of the memory this offset, short Pointer represents at which the value will be written.the value)short value to be written.Writes a |
| public abstract void | putString(long
the offset from the start of the memory this offset, String Pointer represents at which the value will be written.the string to be written. string, int the maximum size of memory to use to store the string. maxLength, Charset the cs)Charset to use to decode the string.Writes a |
| public abstract void | setMemory(long
the offset from the start of the memory location this offset, long Pointer represents to begin writing to.the number of bytes to set to the value. size, byte the value to set each byte to. value)Sets the value of each byte in the memory area represented by this |
| public abstract long | Returns: the size of the memory area thisPointer points to. If
the size is unknown, java. is returned}.Gets the size of this memory object in bytes (optional operation). |
| public abstract Pointer | Returns: aPointer instance representing the new sub-region.the offset from the start of the memory this offset)Pointer
represents at which the new Pointer will start.Creates a new |
| public abstract Pointer | Returns: aPointer instance representing the new sub-region.the offset from the start of the memory this offset, long Pointer
represents at which the new Pointer will start.the maximum size of the memory sub-region. size)Creates a new |
| public String | |
| public abstract void | transferFrom(long
the offset from the start of the memory location this offset, Pointer Pointer represents to begin copying to.the destination memory location to transfer data from. src, long the offset from the start of the memory location the destination srcOffset, long Pointer represents to begin copying from.the number of bytes to transfer. count)Bulk data transfer from one memory location to another. |
| public abstract void | transferTo(long
the offset from the start of the memory location this offset, Pointer Pointer represents to begin copying from.the destination memory location to transfer data to. dst, long the offset from the start of the memory location the destination dstOffset, long Pointer represents to begin copying to.the number of bytes to transfer. count)Bulk data transfer from one memory location to another. |
| public static Pointer | |
| public static Pointer | |
| public static Pointer | Returns: aPointer instance that will proxy all accesses to the ByteBuffer contents.the runtime, ByteBuffer Runtime the wrapped ByteBuffer will
be used with.the buffer)ByteBuffer to wrap.Wraps an existing ByteBuffer in a |
| address | back to summary |
|---|---|
| private final long address | |
| isDirect | back to summary |
|---|---|
| private final boolean isDirect | |
| runtime | back to summary |
|---|---|
| private final Runtime runtime | |
| Pointer | back to summary |
|---|---|
| protected Pointer(Runtime runtime, long address, boolean direct) | |
| address | back to summary |
|---|---|
| public final long address() Gets the native address of this memory object (optional operation).
| |
| array | back to summary |
|---|---|
| public abstract Object array() Returns the array that backs this pointer.
| |
| arrayLength | back to summary |
|---|---|
| public abstract int arrayLength() Returns the length of this pointer's backing array that is used by this pointer.
| |
| arrayOffset | back to summary |
|---|---|
| public abstract int arrayOffset() Returns the offset within this pointer's backing array of the first element.
| |
| checkBounds | back to summary |
|---|---|
| public abstract void checkBounds(long offset, long length) Checks that the memory region is within the bounds of this memory object
| |
| get | back to summary |
|---|---|
| public abstract void get(long offset, byte[] dst, int idx, int len) Bulk get method for multiple
| |
| get | back to summary |
|---|---|
| public abstract void get(long offset, short[] dst, int idx, int len) Bulk get method for multiple
| |
| get | back to summary |
|---|---|
| public abstract void get(long offset, int[] dst, int idx, int len) Bulk get method for multiple
| |
| get | back to summary |
|---|---|
| public abstract void get(long offset, long[] dst, int idx, int len) Bulk get method for multiple
| |
| get | back to summary |
|---|---|
| public abstract void get(long offset, float[] dst, int idx, int len) Bulk get method for multiple
| |
| get | back to summary |
|---|---|
| public abstract void get(long offset, double[] dst, int idx, int len) Bulk get method for multiple
| |
| get | back to summary |
|---|---|
| public void get(long offset, Pointer[] dst, int idx, int len) Bulk get method for multiple
| |
| getAddress | back to summary |
|---|---|
| public abstract long getAddress(long offset) Reads a native memory address value at the given offset. A native address can be either 32 or 64 bits in size, depending on the cpu architecture.
| |
| getByte | back to summary |
|---|---|
| public abstract byte getByte(long offset) Reads an
| |
| getDouble | back to summary |
|---|---|
| public abstract double getDouble(long offset) Reads a
| |
| getFloat | back to summary |
|---|---|
| public abstract float getFloat(long offset) Reads a
| |
| getInt | back to summary |
|---|---|
| public abstract int getInt(long offset) Reads an
| |
| getInt | back to summary |
|---|---|
| public abstract long getInt(Type type, long offset) Reads an integer value of the given type, at the given offset.
| |
| getLong | back to summary |
|---|---|
| public abstract long getLong(long offset) Reads a
| |
| getLongLong | back to summary |
|---|---|
| public abstract long getLongLong(long offset) Reads a
| |
| getNativeLong | back to summary |
|---|---|
| public abstract long getNativeLong(long offset) Reads a native A native For windows, a long is always 32 bits (4 bytes) in size, but on unix systems, a long on a 32bit system is 32 bits, and on a 64bit system, is 64 bits.
| |
| getNullTerminatedPointerArray | back to summary |
|---|---|
| public Pointer[] getNullTerminatedPointerArray(long offset) | |
| getNullTerminatedStringArray | back to summary |
|---|---|
| public String[] getNullTerminatedStringArray(long offset) | |
| getPointer | back to summary |
|---|---|
| public abstract Pointer getPointer(long offset) Reads an
| |
| getPointer | back to summary |
|---|---|
| public abstract Pointer getPointer(long offset, long size) Reads an
| |
| getRuntime | back to summary |
|---|---|
| public final Runtime getRuntime() Gets the
| |
| getShort | back to summary |
|---|---|
| public abstract short getShort(long offset) Reads a
| |
| getString | back to summary |
|---|---|
| public abstract String getString(long offset) Reads an
| |
| getString | back to summary |
|---|---|
| public abstract String getString(long offset, int maxLength, Charset cs) Reads a | |
| hasArray | back to summary |
|---|---|
| public abstract boolean hasArray() Indicates whether this
| |
| indexOf | back to summary |
|---|---|
| public abstract int indexOf(long offset, byte value) Returns the location of a byte value within the memory area represented by this
| |
| indexOf | back to summary |
|---|---|
| public abstract int indexOf(long offset, byte value, int maxlen) Returns the location of a byte value within the memory area represented by this
| |
| isDirect | back to summary |
|---|---|
| public final boolean isDirect() Indicates whether or not this memory object represents a native memory address. Memory objects can be either direct (representing native memory), or non-direct (representing java heap memory). Non-direct memory objects can still be passed to native functions as pointer (void *, char *, etc) parameters, but the java memory will first be copied to a temporary native memory area. The temporary memory area will then be used as the parameter value for the call. If needed, the java memory will be automatically reloaded from the temporary native memory after the native function returns. Note the transient nature of the temporary memory allocated for non-direct memory means native functions which store the address value passed to them will fail in unpredictable ways when using non-direct memory. You will need to explicitly allocate direct memory to use those types of functions.
| |
| newIntPointer | back to summary |
|---|---|
| public static Pointer newIntPointer(Runtime runtime, long address) Wraps an integer value in an opaque | |
| put | back to summary |
|---|---|
| public abstract void put(long offset, byte[] src, int idx, int len) Bulk put method for multiple
| |
| put | back to summary |
|---|---|
| public abstract void put(long offset, short[] src, int idx, int len) Bulk put method for multiple
| |
| put | back to summary |
|---|---|
| public abstract void put(long offset, int[] src, int idx, int len) Bulk put method for multiple
| |
| put | back to summary |
|---|---|
| public abstract void put(long offset, long[] src, int idx, int len) Bulk put method for multiple
| |
| put | back to summary |
|---|---|
| public abstract void put(long offset, float[] src, int idx, int len) Bulk put method for multiple
| |
| put | back to summary |
|---|---|
| public abstract void put(long offset, double[] src, int idx, int len) Bulk put method for multiple
| |
| put | back to summary |
|---|---|
| public void put(long offset, Pointer[] src, int idx, int len) Bulk put method for multiple
| |
| putAddress | back to summary |
|---|---|
| public abstract void putAddress(long offset, long value) Writes a native memory address value at the given offset. A native address can be either 32 or 64 bits in size, depending on the cpu architecture.
| |
| putAddress | back to summary |
|---|---|
| public abstract void putAddress(long offset, Address value) Writes a native memory address value at the given offset. A native address can be either 32 or 64 bits in size, depending on the cpu architecture. | |
| putByte | back to summary |
|---|---|
| public abstract void putByte(long offset, byte value) Writes a
| |
| putDouble | back to summary |
|---|---|
| public abstract void putDouble(long offset, double value) Writes a
| |
| putFloat | back to summary |
|---|---|
| public abstract void putFloat(long offset, float value) Writes a
| |
| putInt | back to summary |
|---|---|
| public abstract void putInt(long offset, int value) Writes an
| |
| putInt | back to summary |
|---|---|
| public abstract void putInt(Type type, long offset, long value) Writes an integer of a specific type, at the given offset.
| |
| putLong | back to summary |
|---|---|
| public abstract void putLong(long offset, long value) Writes a
| |
| putLongLong | back to summary |
|---|---|
| public abstract void putLongLong(long offset, long value) Writes a
| |
| putNativeLong | back to summary |
|---|---|
| public abstract void putNativeLong(long offset, long value) Writes a native A native For windows, a long is always 32 bits (4 bytes) in size, but on unix systems, a long on a 32bit system is 32 bits, and on a 64bit system, is 64 bits.
| |
| putPointer | back to summary |
|---|---|
| public abstract void putPointer(long offset, Pointer value) Writes a
| |
| putShort | back to summary |
|---|---|
| public abstract void putShort(long offset, short value) Writes a
| |
| putString | back to summary |
|---|---|
| public abstract void putString(long offset, String string, int maxLength, Charset cs) Writes a | |
| setMemory | back to summary |
|---|---|
| public abstract void setMemory(long offset, long size, byte value) Sets the value of each byte in the memory area represented by this
| |
| size | back to summary |
|---|---|
| public abstract long size() Gets the size of this memory object in bytes (optional operation).
| |
| slice | back to summary |
|---|---|
| public abstract Pointer slice(long offset) Creates a new
| |
| slice | back to summary |
|---|---|
| public abstract Pointer slice(long offset, long size) Creates a new
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
| |
| transferFrom | back to summary |
|---|---|
| public abstract void transferFrom(long offset, Pointer src, long srcOffset, long count) Bulk data transfer from one memory location to another.
| |
| transferTo | back to summary |
|---|---|
| public abstract void transferTo(long offset, Pointer dst, long dstOffset, long count) Bulk data transfer from one memory location to another.
| |
| wrap | back to summary |
|---|---|
| public static Pointer wrap(Runtime runtime, long address) Wraps a native address in a | |
| wrap | back to summary |
|---|---|
| public static Pointer wrap(Runtime runtime, long address, long size) Wraps a native address in a | |
| wrap | back to summary |
|---|---|
| public static Pointer wrap(Runtime runtime, ByteBuffer buffer) Wraps an existing ByteBuffer in a Wrapping a ByteBuffer is only neccessary if the native function parameter
was declared as a
| |