write,
read, getXXX, and setXXX, provide
means to access memory underlying the native pointer.The constructors are intentionally package-private, since it's not generally a good idea to be creating C pointers de novo.
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 |
| pack-priv long | peer
Pointer value of the real native pointer. |
| public static final int | SIZE
Size of a native pointer, in bytes. |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private static native byte | |
| private static native char | |
| private native ByteBuffer | Returns: a direct ByteBuffer that accesses the memory being pointed to,byte offset from pointer to start the buffer addr, long Length of ByteBuffer length)Get a direct ByteBuffer mapped to the memory pointed to by the pointer. |
| private static native double | |
| private native float | |
| private static native int | |
| private static native long | |
| private static native Pointer | |
| private static native short | |
| private static native String | |
| private static native long | |
| private static native void | |
| private static native void | |
| private static native void | |
| private static native void | |
| private static native void | |
| private static native void | |
| private static native void | |
| private static native void | |
| private static native void | |
| private static native void | |
| private static native void | |
| private static native void | |
| private static native void | |
| private static native void | |
| private static native void | |
| private static native void | |
| private static native void | |
| private static native void | |
| private static native void | |
| private static native void | |
| private static native void | |
| private static native void | |
| private static native void | |
| private static native void | |
| pack-priv void | |
| public static final Pointer | |
| public boolean | Returns: True if the other object is aPointer,
and the C pointers being pointed to by these objects are also
equal. Returns false otherwise.A o)Pointer instanceOverrides java. Pointer to the specified object.
|
| 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[] | |
| 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[] | |
| 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[] | |
| 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[] | |
| 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[] | |
| 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[] | |
| 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 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[] | |
| public String | Returns: theString value being pointed tobyte offset from pointer to obtain the native string
v * @param wide whether to convert from a wide or standard C string offset, boolean wide)Copy native memory to a Java String. |
| public String | Returns: theString value being pointed tobyte offset from pointer to obtain the native string offset)Copy native memory to a Java String. |
| public int | Returns: A hash code value for the represented native pointerOverrides java. Pointer object
|
| 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 void | read(long
byte offset from pointer into which data is copied offset, byte[] byte array into which data is copiedarray index from which to start copying 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. |
| 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 | setString(long
byte offset from pointer at which characters in
offset, String value must be setjava.lang.String value to setwhether to write the native string as an array of
wide)wchar_t. If false, writes as a NUL-terminated array of
char using the default platform encoding.Copy string |
| public void | |
| public Pointer | |
| public Pointer | |
| 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 |