write,
read, getXXX, and setXXX, provide
means to access memory underlying the native pointer.While a constructor exists to create a Pointer from an integer value, it's not generally a good idea to be creating pointers that way.
Function
| Modifier and Type | Class and Description |
|---|---|
| private static class | Pointer.Opaque
Pointer which disallows all read/write access. |
| Modifier and Type | Field and Description |
|---|---|
| public static final Pointer | NULL
Convenience constant, same as |
| protected long | peer
Pointer value of the real native pointer. |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public static final Pointer | |
| public static final Pointer | |
| public String | |
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. |
| public byte | Returns: thebyte value being pointed tooffset from pointer to perform the indirection offset)Indirect the native pointer as a pointer to |
| public byte[] | getByteArray(long offset, int arraySize)
Read a native array of bytes of size |
| public ByteBuffer | Returns: a direct ByteBuffer that accesses the memory being pointed to,byte offset from pointer to start the buffer offset, long Length of ByteBuffer length)Get a ByteBuffer mapped to the memory pointed to by the pointer, ensuring the buffer uses native byte order. |
| public char | Returns: thewchar_t value being pointed tooffset from pointer to perform the indirection offset)Indirect the native pointer as a pointer to |
| public char[] | getCharArray(long offset, int arraySize)
Read a native array of wchar_t of size |
| public double | Returns: thedouble value being pointed tobyte offset from pointer to perform the indirection offset)Indirect the native pointer as a pointer to |
| public double[] | getDoubleArray(long offset, int arraySize)
Read a native array of double of size |
| public float | Returns: thefloat value being pointed tobyte offset from pointer to perform the indirection offset)Indirect the native pointer as a pointer to |
| public float[] | getFloatArray(long offset, int arraySize)
Read a native array of float of size |
| public int | Returns: theint value being pointed tobyte offset from pointer to perform the indirection offset)Indirect the native pointer as a pointer to |
| public int[] | getIntArray(long offset, int arraySize)
Read a native array of int32 of size |
| public long | Returns: thelong value being pointed tobyte offset from pointer to perform the indirection offset)Indirect the native pointer as a pointer to |
| public long[] | getLongArray(long offset, int arraySize)
Read a native array of int64 of size |
| public NativeLong | Returns: thelong value being pointed tobyte offset from pointer to perform the indirection offset)Indirect the native pointer as a pointer to |
| public Pointer | Returns: aPointer equivalent of the pointer value
being pointed to, or null if the pointer value is
NULL;byte offset from pointer to perform the indirection offset)Indirect the native pointer as a pointer to pointer. |
| public Pointer[] | |
| public Pointer[] | |
| public short | Returns: theshort value being pointed tobyte offset from pointer to perform the indirection offset)Indirect the native pointer as a pointer to |
| public short[] | getShortArray(long offset, int arraySize)
Read a native array of int16 of size |
| public String | Returns: theString value being pointed tobyte offset from pointer to start reading bytes offset)Copy native memory to a Java String. |
| public String | |
| public String[] | |
| public String[] | getStringArray(long offset, String encoding)
Returns an array of |
| public String[] | getStringArray(long offset, int length)
Returns an array of |
| public String[] | getStringArray(long offset, int length, String encoding)
Returns an array of |
| pack-priv Object | |
| public String | |
| public String[] | |
| public String[] | |
| public int | |
| public long | indexOf(long offset, byte value)
Returns the offset of the given value in memory from the given offset, or -1 if the value is not found. |
| public static long | |
| public static void | |
| public void | read(long
byte offset from pointer from which data is copied offset, byte[] byte array into which data is copiedarray index to which data is copied index, int number of elements from native pointer that must be copied length)Indirect the native pointer, copying from memory pointed to by native pointer, into the specified array. |
| public void | read(long
byte offset from pointer from which data is copied offset, short[] short array into which data is copiedarray index to which data is copied index, int number of elements from native pointer that must be copied length)Indirect the native pointer, copying from memory pointed to by native pointer, into the specified array. |
| public void | read(long
byte offset from pointer from which data is copied offset, char[] char array into which data is copiedarray index to which data is copied index, int number of elements from native pointer that must be copied length)Indirect the native pointer, copying from memory pointed to by native pointer, into the specified array. |
| public void | read(long
byte offset from pointer from which data is copied offset, int[] int array into which data is copiedarray index to which data is copied index, int number of elements from native pointer that must be copied length)Indirect the native pointer, copying from memory pointed to by native pointer, into the specified array. |
| public void | read(long
byte offset from pointer from which data is copied offset, long[] long array into which data is copiedarray index to which data is copied index, int number of elements from native pointer that must be copied length)Indirect the native pointer, copying from memory pointed to by native pointer, into the specified array. |
| public void | read(long
byte offset from pointer from which data is copied offset, float[] float array into which data is copiedarray index to which data is copied index, int number of elements from native pointer that must be copied length)Indirect the native pointer, copying from memory pointed to by native pointer, into the specified array. |
| public void | read(long
byte offset from pointer from which data is copied offset, double[] double array into which data is copiedarray index to which data is copied index, int number of elements from native pointer that must be copied length)Indirect the native pointer, copying from memory pointed to by native pointer, into the specified array. |
| public void | read(long
byte offset from pointer from which data is copied offset, Pointer[] Pointer array into which data is copiedarray index to which data is copied index, int number of elements from native pointer that must be copied length)Indirect the native pointer, copying from memory pointed to by native pointer, into the specified array. |
| private void | |
| public void | setByte(long
byte offset from pointer at which offset, byte value must
be setbyte value to setSet |
| public void | setChar(long
byte offset from pointer at which offset, char value
must be setchar value to setSet |
| public void | setDouble(long
byte offset from pointer at which offset, double value
must be setdouble value to setSet |
| public void | setFloat(long
byte offset from pointer at which offset, float value
must be setfloat value to setSet |
| public void | setInt(long
byte offset from pointer at which offset, int value must
be setint value to setSet |
| public void | setLong(long
byte offset from pointer at which offset, long value
must be setlong value to setSet |
| public void | setMemory(long
byte offset from pointer to start offset, long number of bytes to write length, byte value to be written value)Write |
| public void | setNativeLong(long
byte offset from pointer at which offset, NativeLong value
must be setlong value to setSet |
| public void | setPointer(long
byte offset from pointer at which offset, Pointer value
must be setPointer holding the actual pointer value to
set, which may be null to indicate a NULL
pointer.Set |
| public void | setShort(long
byte offset from pointer at which offset, short value must
be setshort value to setSet |
| public void | |
| public void | setString(long
byte offset from pointer at which characters in
offset, String value must be setjava.lang.String value to setCopy bytes out of string |
| public void | |
| pack-priv void | |
| public void | setWideString(long
byte offset from pointer at which characters in
offset, String value must be setjava.lang.String value to setCopy string |
| public Pointer | share(long offset)
Provide a view of this memory using the given offset to calculate a new base address. |
| public Pointer | share(long offset, long sz)
Provide a view of this memory using the given offset to calculate a new base address, bounds-limiting the memory with the given size. |
| public String | |
| public void | write(long
byte offset from pointer into which data is copied offset, byte[] byte array from which to copyarray index from which to start copying index, int number of elements from length)buf that must be
copiedIndirect the native pointer, copying into memory pointed to by native pointer, from the specified array. |
| public void | write(long
byte offset from pointer into which data is copied offset, short[] short array from which to copyarray index from which to start copying index, int number of elements from length)buf that must be
copiedIndirect the native pointer, copying into memory pointed to by native pointer, from the specified array. |
| public void | write(long
byte offset from pointer into which data is copied offset, char[] char array from which to copyarray index from which to start copying index, int number of elements from length)buf that must be
copiedIndirect the native pointer, copying into memory pointed to by native pointer, from the specified array. |
| public void | write(long
byte offset from pointer into which data is copied offset, int[] int array from which to copyarray index from which to start copying index, int number of elements from length)buf that must be
copiedIndirect the native pointer, copying into memory pointed to by native pointer, from the specified array. |
| public void | write(long
byte offset from pointer into which data is copied offset, long[] long array from which to copyarray index from which to start copying index, int number of elements from length)buf that must be
copiedIndirect the native pointer, copying into memory pointed to by native pointer, from the specified array. |
| public void | write(long
byte offset from pointer into which data is copied offset, float[] float array from which to copyarray index from which to start copying index, int number of elements from length)buf that must be
copiedIndirect the native pointer, copying into memory pointed to by native pointer, from the specified array. |
| public void | write(long
byte offset from pointer into which data is copied offset, double[] double array from which to copyarray index from which to start copying index, int number of elements from length)buf that must be
copiedIndirect the native pointer, copying into memory pointed to by native pointer, from the specified array. |
| public void | |
| private void | writeArray(long offset, Object value, Class<?> cls)
Write memory starting at offset from the array with element type cls. |