org.bridj
Class Pointer<T>

java.lang.Object
  extended by org.bridj.Pointer<T>
All Implemented Interfaces:
Comparable<Pointer<?>>, Iterable<T>, Collection<T>, List<T>
Direct Known Subclasses:
TypedPointer

public class Pointer<T>
extends Object
implements Comparable<Pointer<?>>, List<T>

Pointer to a native memory location.
Pointer is the entry point of any pointer-related operation in BridJ.

Manipulating memory

Allocating memory


Nested Class Summary
static interface Pointer.Releaser
          Object responsible for reclamation of some pointed memory when it's not used anymore.
static class Pointer.StringType
          Type of a native character string.
 
Field Summary
static Pointer NULL
          The NULL pointer is always Java's null value
static int SIZE
          Size of a pointer in bytes.
 
Method Summary
 void add(int index, T element)
          Deprecated. 
 boolean add(T item)
          Deprecated. 
 boolean addAll(Collection<? extends T> c)
          Deprecated. 
 boolean addAll(int index, Collection<? extends T> c)
          Deprecated. 
static
<V> Pointer<V>
allocate(Class<V> elementClass)
          Create a memory area large enough to a single items of type elementClass.
static
<V> Pointer<V>
allocate(PointerIO<V> io)
          Create a memory area large enough to hold one item of the type associated to the provided PointerIO instance (see PointerIO.getTargetType())
static
<V> Pointer<V>
allocateArray(Class<V> elementClass, long arrayLength)
          Create a memory area large enough to hold arrayLength items of type elementClass.
static
<V> Pointer<V>
allocateArray(PointerIO<V> io, long arrayLength)
          Create a memory area large enough to hold arrayLength items of the type associated to the provided PointerIO instance (see PointerIO.getTargetType())
static
<V> Pointer<V>
allocateArray(PointerIO<V> io, long arrayLength, Pointer.Releaser beforeDeallocation)
          Create a memory area large enough to hold arrayLength items of the type associated to the provided PointerIO instance (see PointerIO.getTargetType())
static Pointer<Boolean> allocateBoolean()
          Allocate enough memory for a boolean value and return a pointer to it.
static Pointer<Boolean> allocateBooleans(long arrayLength)
          Allocate enough memory for arrayLength boolean values and return a pointer to that memory.
static Pointer<Pointer<Boolean>> allocateBooleans(long dim1, long dim2)
          Allocate enough memory for dim1 * dim2 boolean values in a packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Pointer<Pointer<Boolean>>> allocateBooleans(long dim1, long dim2, long dim3)
          Allocate enough memory for dim1 * dim2 * dim3 boolean values in a packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Byte> allocateByte()
          Allocate enough memory for a byte value and return a pointer to it.
static Pointer<Byte> allocateBytes(long arrayLength)
          Allocate enough memory for arrayLength byte values and return a pointer to that memory.
static Pointer<Pointer<Byte>> allocateBytes(long dim1, long dim2)
          Allocate enough memory for dim1 * dim2 byte values in a packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Pointer<Pointer<Byte>>> allocateBytes(long dim1, long dim2, long dim3)
          Allocate enough memory for dim1 * dim2 * dim3 byte values in a packed multi-dimensional C array and return a pointer to that memory.
static
<V> Pointer<V>
allocateBytes(PointerIO<V> io, long byteSize, Pointer.Releaser beforeDeallocation)
          Create a memory area large enough to hold byteSize consecutive bytes and return a pointer to elements of the type associated to the provided PointerIO instance (see PointerIO.getTargetType())
static Pointer<Character> allocateChar()
          Allocate enough memory for a char value and return a pointer to it.
static Pointer<Character> allocateChars(long arrayLength)
          Allocate enough memory for arrayLength char values and return a pointer to that memory.
static Pointer<Pointer<Character>> allocateChars(long dim1, long dim2)
          Allocate enough memory for dim1 * dim2 char values in a packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Pointer<Pointer<Character>>> allocateChars(long dim1, long dim2, long dim3)
          Allocate enough memory for dim1 * dim2 * dim3 char values in a packed multi-dimensional C array and return a pointer to that memory.
static Pointer<CLong> allocateCLong()
          Allocate enough memory for a CLong value and return a pointer to it.
static Pointer<CLong> allocateCLongs(long arrayLength)
          Allocate enough memory for arrayLength CLong values and return a pointer to that memory.
static Pointer<Double> allocateDouble()
          Allocate enough memory for a double value and return a pointer to it.
static Pointer<Double> allocateDoubles(long arrayLength)
          Allocate enough memory for arrayLength double values and return a pointer to that memory.
static Pointer<Pointer<Double>> allocateDoubles(long dim1, long dim2)
          Allocate enough memory for dim1 * dim2 double values in a packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Pointer<Pointer<Double>>> allocateDoubles(long dim1, long dim2, long dim3)
          Allocate enough memory for dim1 * dim2 * dim3 double values in a packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Float> allocateFloat()
          Allocate enough memory for a float value and return a pointer to it.
static Pointer<Float> allocateFloats(long arrayLength)
          Allocate enough memory for arrayLength float values and return a pointer to that memory.
static Pointer<Pointer<Float>> allocateFloats(long dim1, long dim2)
          Allocate enough memory for dim1 * dim2 float values in a packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Pointer<Pointer<Float>>> allocateFloats(long dim1, long dim2, long dim3)
          Allocate enough memory for dim1 * dim2 * dim3 float values in a packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Integer> allocateInt()
          Allocate enough memory for a int value and return a pointer to it.
static Pointer<Integer> allocateInts(long arrayLength)
          Allocate enough memory for arrayLength int values and return a pointer to that memory.
static Pointer<Pointer<Integer>> allocateInts(long dim1, long dim2)
          Allocate enough memory for dim1 * dim2 int values in a packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Pointer<Pointer<Integer>>> allocateInts(long dim1, long dim2, long dim3)
          Allocate enough memory for dim1 * dim2 * dim3 int values in a packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Long> allocateLong()
          Allocate enough memory for a long value and return a pointer to it.
static Pointer<Long> allocateLongs(long arrayLength)
          Allocate enough memory for arrayLength long values and return a pointer to that memory.
static Pointer<Pointer<Long>> allocateLongs(long dim1, long dim2)
          Allocate enough memory for dim1 * dim2 long values in a packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Pointer<Pointer<Long>>> allocateLongs(long dim1, long dim2, long dim3)
          Allocate enough memory for dim1 * dim2 * dim3 long values in a packed multi-dimensional C array and return a pointer to that memory.
static
<V> Pointer<Pointer<?>>
allocatePointer()
          Create a memory area large enough to hold an untyped pointer.
static
<P> Pointer<Pointer<P>>
allocatePointer(Class<P> targetType)
          Create a memory area large enough to hold a pointer.
static
<P> Pointer<Pointer<P>>
allocatePointer(Type targetType)
          Create a memory area large enough to hold a pointer.
static
<P> Pointer<Pointer<Pointer<P>>>
allocatePointerPointer(Class<P> targetType)
          Create a memory area large enough to hold a pointer to a pointer
static
<P> Pointer<Pointer<Pointer<P>>>
allocatePointerPointer(Type targetType)
          Create a memory area large enough to hold a pointer to a pointer
static
<P> Pointer<Pointer<P>>
allocatePointers(Class<P> targetType, int arrayLength)
          Create a memory area large enough to hold an array of arrayLength typed pointers.
static Pointer<Pointer<?>> allocatePointers(int arrayLength)
          Allocate enough memory for arrayLength untyped pointer values and return a pointer to that memory.
static
<P> Pointer<Pointer<P>>
allocatePointers(Type targetType, int arrayLength)
          Create a memory area large enough to hold an array of arrayLength typed pointers.
static Pointer<Short> allocateShort()
          Allocate enough memory for a short value and return a pointer to it.
static Pointer<Short> allocateShorts(long arrayLength)
          Allocate enough memory for arrayLength short values and return a pointer to that memory.
static Pointer<Pointer<Short>> allocateShorts(long dim1, long dim2)
          Allocate enough memory for dim1 * dim2 short values in a packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Pointer<Pointer<Short>>> allocateShorts(long dim1, long dim2, long dim3)
          Allocate enough memory for dim1 * dim2 * dim3 short values in a packed multi-dimensional C array and return a pointer to that memory.
static Pointer<SizeT> allocateSizeT()
          Allocate enough memory for a SizeT value and return a pointer to it.
static Pointer<SizeT> allocateSizeTs(long arrayLength)
          Allocate enough memory for arrayLength SizeT values and return a pointer to that memory.
static
<P extends TypedPointer>
Pointer<P>
allocateTypedPointer(Class<P> type)
          Allocate enough memory for a typed pointer value and return a pointer to it.
static
<P extends TypedPointer>
Pointer<P>
allocateTypedPointers(Class<P> type, long arrayLength)
          Allocate enough memory for arrayLength typed pointer values and return a pointer to that memory.
 T apply(long index)
          Alias for get(long) defined for more natural use from the Scala language.
<U> Pointer<U>
as(Class<U> type)
          Cast this pointer to another pointer type.
<U> Pointer<U>
as(PointerIO<U> newIO)
          Cast this pointer to another pointer type
<U> Pointer<U>
asPointerTo(Type type)
          Cast this pointer to another pointer type
Synonym of as(Class)
The following C code :
T* pointerT = ...; U* pointerU = (U*)pointerT;
Can be translated to the following Java code :
Pointer<T> pointerT = ...; Pointer<U> pointerU = pointerT.as(U.class); // or pointerT.asPointerTo(U.class);
 Pointer<?> asUntyped()
          Cast this pointer to an untyped pointer.
 void clear()
          Deprecated. 
 void clearBytes(long length)
          Write zero bytes to the first length bytes pointed by this pointer
 void clearBytesAtOffset(long byteOffset, long length, byte value)
          Write a byte value to each of the length bytes at the address pointed to by this pointer shifted by a byteOffset
 int compareBytes(Pointer<?> other, long byteCount)
          Compare the byteCount bytes at the memory location pointed by this pointer to the byteCount bytes at the memory location pointer by other using the C @see memcmp function.
 int compareBytesAtOffset(long byteOffset, Pointer<?> other, long otherByteOffset, long byteCount)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues)
 int compareTo(Pointer<?> p)
          Compare to another pointer based on pointed addresses.
 boolean contains(Object o)
          Deprecated. 
 boolean containsAll(Collection<?> c)
          Deprecated. 
 Pointer<T> copyBytesTo(long byteOffset, Pointer<?> destination, long byteOffsetInDestination, long byteCount)
          Deprecated. 
 void copyTo(Pointer<?> destination)
          Copy remaining bytes from this pointer to a destination using the @see memcpy C function (see copyBytesTo(long, Pointer, long, long), getValidBytes())
 void copyTo(Pointer<?> destination, long elementCount)
          Copy remaining elements from this pointer to a destination using the @see memcpy C function (see copyBytesTo(long, Pointer, long, long), getValidBytes())
 boolean equals(Object obj)
          Test equality of the pointer using the address.
 Pointer<T> findByte(long byteOffset, byte value, long searchLength)
          Find the first occurrence of a value in the memory block of length searchLength bytes pointed by this pointer shifted by a byteOffset
 T get()
          Dereference this pointer (*ptr).
 T get(int index)
          Implementation of List.get(int)
 T get(long index)
          Gets the n-th element from this pointer.
static long getAddress(NativeObject instance, Class targetType)
          Get the address of a native object, specifying the type of the pointer's target (same as pointerTo(instance, targetType).getPeer(), see pointerTo(NativeObject, Class)).
 Object getArray()
          Read the array of remaining elements from the pointed memory location.
 Object getArray(int length)
          Read an array of elements from the pointed memory location.
 Object getArrayAtOffset(long byteOffset, int length)
          Read an array of elements from the pointed memory location shifted by a byte offset.
 boolean getBoolean()
          Read a boolean value from the pointed memory location
 boolean getBooleanAtOffset(long byteOffset)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getBoolean() over this method.
 boolean[] getBooleans()
          Read the array of remaining boolean values from the pointed memory location
 boolean[] getBooleans(int length)
          Read an array of boolean values of the specified length from the pointed memory location
 boolean[] getBooleansAtOffset(long byteOffset, int length)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getBooleans(int) over this method.
<B extends Buffer>
B
getBuffer()
          Read the NIO Buffer of remaining elements from the pointed memory location.
<B extends Buffer>
B
getBuffer(int length)
          Read an NIO Buffer of elements from the pointed memory location.
<B extends Buffer>
B
getBufferAtOffset(long byteOffset, int length)
          Read an NIO Buffer of elements from the pointed memory location shifted by a byte offset.
 byte getByte()
          Read a byte value from the pointed memory location
 byte getByteAtOffset(long byteOffset)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getByte() over this method.
 ByteBuffer getByteBuffer()
          Read a buffer of byte values of the remaining length from the pointed memory location
 ByteBuffer getByteBuffer(long length)
          Read a buffer of byte values of the specified length from the pointed memory location
 ByteBuffer getByteBufferAtOffset(long byteOffset, long length)
          Read a buffer of byte values of the specified length from the pointed memory location shifted by a byte offset
 byte[] getBytes()
          Read the array of remaining byte values from the pointed memory location
 void getBytes(byte[] dest)
          Read byte values into the specified destination array from the pointed memory location
 byte[] getBytes(int length)
          Read an array of byte values of the specified length from the pointed memory location
 void getBytesAtOffset(long byteOffset, byte[] dest, int destOffset, int length)
          Read length byte values into the specified destination array from the pointed memory location shifted by a byte offset, storing values after the provided destination offset.
 byte[] getBytesAtOffset(long byteOffset, int length)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getBytes(int) over this method.
 char getChar()
          Read a char value from the pointed memory location
 char getCharAtOffset(long byteOffset)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getChar() over this method.
 CharBuffer getCharBuffer()
          Read a buffer of char values of the remaining length from the pointed memory location
 CharBuffer getCharBuffer(long length)
          Read a buffer of char values of the specified length from the pointed memory location
 CharBuffer getCharBufferAtOffset(long byteOffset, long length)
          Read a buffer of char values of the specified length from the pointed memory location shifted by a byte offset
 char[] getChars()
          Read the array of remaining char values from the pointed memory location
 void getChars(char[] dest)
          Read char values into the specified destination array from the pointed memory location
 char[] getChars(int length)
          Read an array of char values of the specified length from the pointed memory location
 void getCharsAtOffset(long byteOffset, char[] dest, int destOffset, int length)
          Read length char values into the specified destination array from the pointed memory location shifted by a byte offset, storing values after the provided destination offset.
 char[] getCharsAtOffset(long byteOffset, int length)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getChars(int) over this method.
 long getCLong()
          Read a CLong value from the pointed memory location
 long getCLongAtOffset(long byteOffset)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getCLong() over this method.
 long[] getCLongs()
          Read the array of remaining CLong values from the pointed memory location
 long[] getCLongs(int arrayLength)
          Read an array of CLong values of the specified length from the pointed memory location
 long[] getCLongsAtOffset(long byteOffset, int arrayLength)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getCLongs(int) over this method.
 String getCString()
          Read a C string using the default charset from the pointed memory location (see Pointer.StringType.C).
 String getCStringAtOffset(long byteOffset)
          Read a C string using the default charset from the pointed memory location shifted by a byte offset (see Pointer.StringType.C).
 double getDouble()
          Read a double value from the pointed memory location
 double getDoubleAtOffset(long byteOffset)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getDouble() over this method.
 DoubleBuffer getDoubleBuffer()
          Read a buffer of double values of the remaining length from the pointed memory location
 DoubleBuffer getDoubleBuffer(long length)
          Read a buffer of double values of the specified length from the pointed memory location
 DoubleBuffer getDoubleBufferAtOffset(long byteOffset, long length)
          Read a buffer of double values of the specified length from the pointed memory location shifted by a byte offset
 double[] getDoubles()
          Read the array of remaining double values from the pointed memory location
 void getDoubles(double[] dest)
          Read double values into the specified destination array from the pointed memory location
 double[] getDoubles(int length)
          Read an array of double values of the specified length from the pointed memory location
 void getDoublesAtOffset(long byteOffset, double[] dest, int destOffset, int length)
          Read length double values into the specified destination array from the pointed memory location shifted by a byte offset, storing values after the provided destination offset.
 double[] getDoublesAtOffset(long byteOffset, int length)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getDoubles(int) over this method.
 float getFloat()
          Read a float value from the pointed memory location
 float getFloatAtOffset(long byteOffset)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getFloat() over this method.
 FloatBuffer getFloatBuffer()
          Read a buffer of float values of the remaining length from the pointed memory location
 FloatBuffer getFloatBuffer(long length)
          Read a buffer of float values of the specified length from the pointed memory location
 FloatBuffer getFloatBufferAtOffset(long byteOffset, long length)
          Read a buffer of float values of the specified length from the pointed memory location shifted by a byte offset
 float[] getFloats()
          Read the array of remaining float values from the pointed memory location
 void getFloats(float[] dest)
          Read float values into the specified destination array from the pointed memory location
 float[] getFloats(int length)
          Read an array of float values of the specified length from the pointed memory location
 void getFloatsAtOffset(long byteOffset, float[] dest, int destOffset, int length)
          Read length float values into the specified destination array from the pointed memory location shifted by a byte offset, storing values after the provided destination offset.
 float[] getFloatsAtOffset(long byteOffset, int length)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getFloats(int) over this method.
 int getInt()
          Read a int value from the pointed memory location
 int getIntAtOffset(long byteOffset)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getInt() over this method.
 IntBuffer getIntBuffer()
          Read a buffer of int values of the remaining length from the pointed memory location
 IntBuffer getIntBuffer(long length)
          Read a buffer of int values of the specified length from the pointed memory location
 IntBuffer getIntBufferAtOffset(long byteOffset, long length)
          Read a buffer of int values of the specified length from the pointed memory location shifted by a byte offset
 int[] getInts()
          Read the array of remaining int values from the pointed memory location
 int[] getInts(int length)
          Read an array of int values of the specified length from the pointed memory location
 void getInts(int[] dest)
          Read int values into the specified destination array from the pointed memory location
 int[] getIntsAtOffset(long byteOffset, int length)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getInts(int) over this method.
 void getIntsAtOffset(long byteOffset, int[] dest, int destOffset, int length)
          Read length int values into the specified destination array from the pointed memory location shifted by a byte offset, storing values after the provided destination offset.
 PointerIO<T> getIO()
          Get the PointerIO instance used by this pointer to get and set pointed values.
 long getLong()
          Read a long value from the pointed memory location
 long getLongAtOffset(long byteOffset)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getLong() over this method.
 LongBuffer getLongBuffer()
          Read a buffer of long values of the remaining length from the pointed memory location
 LongBuffer getLongBuffer(long length)
          Read a buffer of long values of the specified length from the pointed memory location
 LongBuffer getLongBufferAtOffset(long byteOffset, long length)
          Read a buffer of long values of the specified length from the pointed memory location shifted by a byte offset
 long[] getLongs()
          Read the array of remaining long values from the pointed memory location
 long[] getLongs(int length)
          Read an array of long values of the specified length from the pointed memory location
 void getLongs(long[] dest)
          Read long values into the specified destination array from the pointed memory location
 long[] getLongsAtOffset(long byteOffset, int length)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getLongs(int) over this method.
 void getLongsAtOffset(long byteOffset, long[] dest, int destOffset, int length)
          Read length long values into the specified destination array from the pointed memory location shifted by a byte offset, storing values after the provided destination offset.
<O extends NativeObject>
O
getNativeObject(Class<O> type)
          Read a native object value from the pointed memory location
<O extends NativeObject>
O
getNativeObject(Type type)
          Read a native object value from the pointed memory location
<O extends NativeObject>
O
getNativeObjectAtOffset(long byteOffset, Class<O> type)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getNativeObject(Class) over this method.
<O extends NativeObject>
O
getNativeObjectAtOffset(long byteOffset, Type type)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getNativeObject(Type) over this method.
 long getPeer()
          Get the address of the memory pointed to by this pointer ("cast this pointer to long", in C jargon).
static long getPeer(Pointer<?> pointer)
          Get a pointer's peer (see getPeer()), or zero if the pointer is null.
 Pointer<?> getPointer()
          Deprecated. Avoid using untyped pointers, if possible.
<U> Pointer<U>
getPointer(Class<U> c)
          Read a pointer value from the pointed memory location.
<U> Pointer<U>
getPointer(PointerIO<U> pio)
          Read a pointer value from the pointed memory location
 Pointer<?> getPointerAtOffset(long byteOffset)
          Read a pointer value from the pointed memory location shifted by a byte offset
<U> Pointer<U>
getPointerAtOffset(long byteOffset, Class<U> c)
          Read a pointer value from the pointed memory location shifted by a byte offset
<U> Pointer<U>
getPointerAtOffset(long byteOffset, PointerIO<U> pio)
          Read a pointer value from the pointed memory location shifted by a byte offset
<U> Pointer<U>
getPointerAtOffset(long byteOffset, Type t)
          Read a pointer value from the pointed memory location shifted by a byte offset
 Pointer<?>[] getPointers()
          Deprecated. Use a typed version instead : getPointersAtOffset(long, int, Type), Pointer#getPointers(long, int, Class) or getPointersAtOffset(long, int, PointerIO)
 Pointer<?>[] getPointers(int arrayLength)
          Deprecated. Use a typed version instead : getPointersAtOffset(long, int, Type), Pointer#getPointers(long, int, Class) or getPointersAtOffset(long, int, PointerIO)
 Pointer<?>[] getPointersAtOffset(long byteOffset, int arrayLength)
          Deprecated. Use a typed version instead : getPointersAtOffset(long, int, Type), Pointer#getPointers(long, int, Class) or getPointersAtOffset(long, int, PointerIO)
<U> Pointer<U>[]
getPointersAtOffset(long byteOffset, int arrayLength, Class<U> t)
          Read an array of pointer values from the pointed memory location shifted by a byte offset
<U> Pointer<U>[]
getPointersAtOffset(long byteOffset, int arrayLength, PointerIO pio)
          Read an array of pointer values from the pointed memory location shifted by a byte offset
<U> Pointer<U>[]
getPointersAtOffset(long byteOffset, int arrayLength, Type t)
          Read an array of pointer values from the pointed memory location shifted by a byte offset
 Pointer<Pointer<T>> getReference()
          Returns a pointer to this pointer.
 short getShort()
          Read a short value from the pointed memory location
 short getShortAtOffset(long byteOffset)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getShort() over this method.
 ShortBuffer getShortBuffer()
          Read a buffer of short values of the remaining length from the pointed memory location
 ShortBuffer getShortBuffer(long length)
          Read a buffer of short values of the specified length from the pointed memory location
 ShortBuffer getShortBufferAtOffset(long byteOffset, long length)
          Read a buffer of short values of the specified length from the pointed memory location shifted by a byte offset
 short[] getShorts()
          Read the array of remaining short values from the pointed memory location
 short[] getShorts(int length)
          Read an array of short values of the specified length from the pointed memory location
 void getShorts(short[] dest)
          Read short values into the specified destination array from the pointed memory location
 short[] getShortsAtOffset(long byteOffset, int length)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getShorts(int) over this method.
 void getShortsAtOffset(long byteOffset, short[] dest, int destOffset, int length)
          Read length short values into the specified destination array from the pointed memory location shifted by a byte offset, storing values after the provided destination offset.
 long getSizeT()
          Read a SizeT value from the pointed memory location
 long getSizeTAtOffset(long byteOffset)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getSizeT() over this method.
 long[] getSizeTs()
          Read the array of remaining SizeT values from the pointed memory location
 long[] getSizeTs(int arrayLength)
          Read an array of SizeT values of the specified length from the pointed memory location
 long[] getSizeTsAtOffset(long byteOffset, int arrayLength)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getSizeTs(int) over this method.
 String getString(Pointer.StringType type)
          Read a native string from the pointed memory location using the default charset.
 String getString(Pointer.StringType type, Charset charset)
          Read a native string from the pointed memory location, using the provided charset or the system's default if not provided.
 String getStringAtOffset(long byteOffset, Pointer.StringType type, Charset charset)
          Read a native string from the pointed memory location shifted by a byte offset, using the provided charset or the system's default if not provided.
 long getTargetSize()
          Get the unitary size of the pointed elements in bytes.
 Type getTargetType()
          Get the type of pointed elements.
 long getValidBytes()
          Get the amount of memory known to be valid from this pointer, or -1 if it is unknown.
 long getValidElements()
          Get the amount of memory known to be valid from this pointer (expressed in elements of the target type, see getTargetType()) or -1 if it is unknown.
 String getWideCString()
          Read a WideC string using the default charset from the pointed memory location (see Pointer.StringType.WideC).
 String getWideCStringAtOffset(long byteOffset)
          Read a WideC string using the default charset from the pointed memory location shifted by a byte offset (see Pointer.StringType.WideC).
 int hashCode()
          Compute a hash code based on pointed address.
 int indexOf(Object o)
          Deprecated. 
static
<E extends Enum<E>>
Type
intEnumType(Class<? extends IntValuedEnum<E>> targetType)
          Create a IntValuedEnum<T> type.
 boolean isAligned()
          Check that the pointer's peer is aligned to the target type alignment.
 boolean isAligned(int alignment)
          Check that the pointer's peer is aligned to the given alignment.
 boolean isEmpty()
          Implementation of List.isEmpty()
 ListIterator<T> iterator()
          Returns an iterator over the elements pointed by this pointer.
 int lastIndexOf(Object o)
          Deprecated. 
 ListIterator<T> listIterator()
          Implementation of List.listIterator()
 ListIterator<T> listIterator(int index)
          Implementation of List.listIterator(int)
 Pointer<T> moveBytesTo(long byteOffset, Pointer<?> destination, long byteOffsetInDestination, long byteCount)
          Deprecated. 
 Pointer<T> next()
          Returns a pointer to the next target.
 Pointer<T> next(long delta)
          Returns a pointer to the n-th next (or previous) target.
 Pointer<T> offset(long byteOffset)
          Returns a pointer which address value was obtained by this pointer's by adding a byte offset.
 ByteOrder order()
          Get the byte order (endianness) of this pointer.
 Pointer<T> order(ByteOrder order)
          Create a clone of this pointer that has the byte order provided in argument, or return this if this pointer already uses the requested byte order.
static
<N extends NativeObject>
Pointer<N>
pointerTo(N instance)
          Get a pointer to a native object (C++ or ObjectiveC class, struct, union, callback...)
static
<R extends NativeObject>
Pointer<R>
pointerTo(NativeObject instance, Class<R> targetType)
          Get a pointer to a native object, specifying the type of the pointer's target.
static Pointer<?> pointerToAddress(long peer)
          Deprecated. 
static Pointer<?> pointerToAddress(long peer, Class<?> targetClass, Pointer.Releaser releaser)
          Create a pointer out of a native memory address
static
<P> Pointer<P>
pointerToAddress(long peer, Class<P> targetClass)
          Deprecated. 
static Pointer<?> pointerToAddress(long peer, long size)
          Deprecated. 
static Pointer<?> pointerToAddress(long peer, long size, Pointer.Releaser releaser)
          Create a pointer out of a native memory address
static Pointer<?> pointerToAddress(long peer, Pointer.Releaser releaser)
          Deprecated. 
static
<T> Pointer<T>
pointerToArray(Object array)
          Allocate enough memory for array.length values, copy the values of the array provided as argument into it and return a pointer to that memory.
static Pointer<Boolean> pointerToBoolean(boolean value)
          Allocate enough memory for a single boolean value, copy the value provided in argument into it and return a pointer to that memory.
static Pointer<Boolean> pointerToBooleans(boolean... values)
          Allocate enough memory for values.length boolean values, copy the values provided as argument into it and return a pointer to that memory.
static Pointer<Pointer<Boolean>> pointerToBooleans(boolean[][] values)
          Allocate enough memory for all the values in the 2D boolean array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Pointer<Pointer<Boolean>>> pointerToBooleans(boolean[][][] values)
          Allocate enough memory for all the values in the 3D boolean array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
static Pointer<?> pointerToBuffer(Buffer buffer)
          Create a pointer to the memory location used by a direct NIO buffer.
static Pointer<Byte> pointerToByte(byte value)
          Allocate enough memory for a single byte value, copy the value provided in argument into it and return a pointer to that memory.
static Pointer<Byte> pointerToBytes(byte... values)
          Allocate enough memory for values.length byte values, copy the values provided as argument into it and return a pointer to that memory.
static Pointer<Pointer<Byte>> pointerToBytes(byte[][] values)
          Allocate enough memory for all the values in the 2D byte array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Pointer<Pointer<Byte>>> pointerToBytes(byte[][][] values)
          Allocate enough memory for all the values in the 3D byte array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Byte> pointerToBytes(ByteBuffer buffer)
          Create a pointer to the memory location used by a direct NIO ByteBuffer}.
static Pointer<Character> pointerToChar(char value)
          Allocate enough memory for a single char value, copy the value provided in argument into it and return a pointer to that memory.
static Pointer<Character> pointerToChars(char... values)
          Allocate enough memory for values.length char values, copy the values provided as argument into it and return a pointer to that memory.
static Pointer<Pointer<Character>> pointerToChars(char[][] values)
          Allocate enough memory for all the values in the 2D char array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Pointer<Pointer<Character>>> pointerToChars(char[][][] values)
          Allocate enough memory for all the values in the 3D char array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Character> pointerToChars(CharBuffer buffer)
          Create a pointer to the memory location used by a direct NIO CharBuffer}.
static Pointer<CLong> pointerToCLong(CLong value)
          Allocate enough memory for a single CLong value, copy the value provided in argument into it and return a pointer to that memory.
static Pointer<CLong> pointerToCLong(long value)
          Allocate enough memory for a single CLong value, copy the value provided in argument into it and return a pointer to that memory.
static Pointer<CLong> pointerToCLongs(CLong... values)
          Allocate enough memory for values.length CLong values, copy the values provided as argument into it and return a pointer to that memory.
static Pointer<CLong> pointerToCLongs(int[] values)
          Allocate enough memory for values.length CLong values, copy the values provided as argument into it and return a pointer to that memory.
static Pointer<CLong> pointerToCLongs(long... values)
          Allocate enough memory for values.length CLong values, copy the values provided as argument into it and return a pointer to that memory.
static Pointer<Byte> pointerToCString(String string)
          Allocate memory and write a C string to it, using the system's default charset to convert the string.
static Pointer<Pointer<Byte>> pointerToCStrings(String... strings)
          The update will take place inside the release() call
static Pointer<Double> pointerToDouble(double value)
          Allocate enough memory for a single double value, copy the value provided in argument into it and return a pointer to that memory.
static Pointer<Double> pointerToDoubles(double... values)
          Allocate enough memory for values.length double values, copy the values provided as argument into it and return a pointer to that memory.
static Pointer<Pointer<Double>> pointerToDoubles(double[][] values)
          Allocate enough memory for all the values in the 2D double array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Pointer<Pointer<Double>>> pointerToDoubles(double[][][] values)
          Allocate enough memory for all the values in the 3D double array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Double> pointerToDoubles(DoubleBuffer buffer)
          Create a pointer to the memory location used by a direct NIO DoubleBuffer}.
static Pointer<Float> pointerToFloat(float value)
          Allocate enough memory for a single float value, copy the value provided in argument into it and return a pointer to that memory.
static Pointer<Float> pointerToFloats(float... values)
          Allocate enough memory for values.length float values, copy the values provided as argument into it and return a pointer to that memory.
static Pointer<Pointer<Float>> pointerToFloats(float[][] values)
          Allocate enough memory for all the values in the 2D float array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Pointer<Pointer<Float>>> pointerToFloats(float[][][] values)
          Allocate enough memory for all the values in the 3D float array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Float> pointerToFloats(FloatBuffer buffer)
          Create a pointer to the memory location used by a direct NIO FloatBuffer}.
static Pointer<Integer> pointerToInt(int value)
          Allocate enough memory for a single int value, copy the value provided in argument into it and return a pointer to that memory.
static Pointer<Integer> pointerToInts(int... values)
          Allocate enough memory for values.length int values, copy the values provided as argument into it and return a pointer to that memory.
static Pointer<Pointer<Integer>> pointerToInts(int[][] values)
          Allocate enough memory for all the values in the 2D int array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Pointer<Pointer<Integer>>> pointerToInts(int[][][] values)
          Allocate enough memory for all the values in the 3D int array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Integer> pointerToInts(IntBuffer buffer)
          Create a pointer to the memory location used by a direct NIO IntBuffer}.
static Pointer<Long> pointerToLong(long value)
          Allocate enough memory for a single long value, copy the value provided in argument into it and return a pointer to that memory.
static Pointer<Long> pointerToLongs(long... values)
          Allocate enough memory for values.length long values, copy the values provided as argument into it and return a pointer to that memory.
static Pointer<Pointer<Long>> pointerToLongs(long[][] values)
          Allocate enough memory for all the values in the 2D long array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Pointer<Pointer<Long>>> pointerToLongs(long[][][] values)
          Allocate enough memory for all the values in the 3D long array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Long> pointerToLongs(LongBuffer buffer)
          Create a pointer to the memory location used by a direct NIO LongBuffer}.
static
<T> Pointer<Pointer<T>>
pointerToPointer(Pointer<T> value)
          Allocate enough memory for a single pointer value, copy the value provided in argument into it and return a pointer to that memory.
static
<T> Pointer<Pointer<T>>
pointerToPointers(Pointer<T>... values)
          Allocate enough memory for values.length pointer values, copy the values provided as argument into it and return a pointer to that memory.
static Pointer<Short> pointerToShort(short value)
          Allocate enough memory for a single short value, copy the value provided in argument into it and return a pointer to that memory.
static Pointer<Short> pointerToShorts(short... values)
          Allocate enough memory for values.length short values, copy the values provided as argument into it and return a pointer to that memory.
static Pointer<Pointer<Short>> pointerToShorts(short[][] values)
          Allocate enough memory for all the values in the 2D short array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Pointer<Pointer<Short>>> pointerToShorts(short[][][] values)
          Allocate enough memory for all the values in the 3D short array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
static Pointer<Short> pointerToShorts(ShortBuffer buffer)
          Create a pointer to the memory location used by a direct NIO ShortBuffer}.
static Pointer<SizeT> pointerToSizeT(long value)
          Allocate enough memory for a single SizeT value, copy the value provided in argument into it and return a pointer to that memory.
static Pointer<SizeT> pointerToSizeT(SizeT value)
          Allocate enough memory for a single SizeT value, copy the value provided in argument into it and return a pointer to that memory.
static Pointer<SizeT> pointerToSizeTs(int[] values)
          Allocate enough memory for values.length SizeT values, copy the values provided as argument into it and return a pointer to that memory.
static Pointer<SizeT> pointerToSizeTs(long... values)
          Allocate enough memory for values.length SizeT values, copy the values provided as argument into it and return a pointer to that memory.
static Pointer<SizeT> pointerToSizeTs(SizeT... values)
          Allocate enough memory for values.length SizeT values, copy the values provided as argument into it and return a pointer to that memory.
static Pointer<?> pointerToString(String string, Pointer.StringType type, Charset charset)
          Allocate memory and write a string to it, using the system's default charset to convert the string (See Pointer.StringType for details on the supported types).
static Pointer<Character> pointerToWideCString(String string)
          Allocate memory and write a WideC string to it, using the system's default charset to convert the string.
static Pointer<Pointer<Character>> pointerToWideCStrings(String... strings)
          The update will take place inside the release() call
static Type pointerType(Type targetType)
          Create a Pointer<T> type.
 void release()
          Manually release the memory pointed by this pointer if it was allocated on the Java side.
static void release(Pointer... pointers)
          Release pointers, if they're not null (see release()).
 T remove(int index)
          Deprecated. 
 boolean remove(Object o)
          Deprecated. 
 boolean removeAll(Collection<?> c)
          Deprecated. 
 boolean retainAll(Collection<?> c)
          Deprecated. 
 T set(int index, T element)
          Implementation of List.set(int, Object)
 T set(long index, T value)
          Sets the n-th element from this pointer.
 T set(T value)
          Assign a value to the pointed memory location.
 Pointer<T> setArray(Object array)
          Write an array of elements to the pointed memory location.
 Pointer<T> setArrayAtOffset(long byteOffset, Object array)
          Write an array of elements to the pointed memory location shifted by a byte offset.
 Pointer<T> setBoolean(boolean value)
          Write a boolean value to the pointed memory location
 Pointer<T> setBooleanAtOffset(long byteOffset, boolean value)
          Read a boolean value from the pointed memory location shifted by a byte offset
 Pointer<T> setBooleans(boolean[] values)
          Write an array of boolean values of the specified length to the pointed memory location
 Pointer<T> setBooleansAtOffset(long byteOffset, boolean[] values)
          Write an array of boolean values of the specified length to the pointed memory location shifted by a byte offset
 Pointer<T> setBooleansAtOffset(long byteOffset, boolean[] values, int valuesOffset, int length)
          Write an array of boolean values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given array offset and for the given length from the provided array.
 Pointer<T> setByte(byte value)
          Write a byte value to the pointed memory location
 Pointer<T> setByteAtOffset(long byteOffset, byte value)
          Read a byte value from the pointed memory location shifted by a byte offset
 Pointer<T> setBytes(byte[] values)
          Write an array of byte values of the specified length to the pointed memory location
 Pointer<T> setBytes(ByteBuffer values)
          Write a buffer of byte values of the specified length to the pointed memory location
 Pointer<T> setBytesAtOffset(long byteOffset, byte[] values)
          Write an array of byte values of the specified length to the pointed memory location shifted by a byte offset
 Pointer<T> setBytesAtOffset(long byteOffset, byte[] values, int valuesOffset, int length)
          Write an array of byte values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given array offset and for the given length from the provided array.
 Pointer<T> setBytesAtOffset(long byteOffset, ByteBuffer values)
          Write a buffer of byte values of the specified length to the pointed memory location shifted by a byte offset
 Pointer<T> setBytesAtOffset(long byteOffset, ByteBuffer values, long valuesOffset, long length)
          Write a buffer of byte values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given buffer offset and for the given length from the provided buffer.
 Pointer<T> setChar(char value)
          Write a char value to the pointed memory location
 Pointer<T> setCharAtOffset(long byteOffset, char value)
          Read a char value from the pointed memory location shifted by a byte offset
 Pointer<T> setChars(char[] values)
          Write an array of char values of the specified length to the pointed memory location
 Pointer<T> setChars(CharBuffer values)
          Write a buffer of char values of the specified length to the pointed memory location
 Pointer<T> setCharsAtOffset(long byteOffset, char[] values)
          Write an array of char values of the specified length to the pointed memory location shifted by a byte offset
 Pointer<T> setCharsAtOffset(long byteOffset, char[] values, int valuesOffset, int length)
          Write an array of char values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given array offset and for the given length from the provided array.
 Pointer<T> setCharsAtOffset(long byteOffset, CharBuffer values)
          Write a buffer of char values of the specified length to the pointed memory location shifted by a byte offset
 Pointer<T> setCharsAtOffset(long byteOffset, CharBuffer values, long valuesOffset, long length)
          Write a buffer of char values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given buffer offset and for the given length from the provided buffer.
 Pointer<T> setCLong(CLong value)
          Write a CLong value to the pointed memory location
 Pointer<T> setCLong(long value)
          Write a CLong value to the pointed memory location
 Pointer<T> setCLongAtOffset(long byteOffset, CLong value)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour setCLong(CLong) over this method.
 Pointer<T> setCLongAtOffset(long byteOffset, long value)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour setCLong(long) over this method.
 Pointer<T> setCLongs(CLong[] values)
          Write an array of CLong values to the pointed memory location
 Pointer<T> setCLongs(int[] values)
          Write an array of CLong values to the pointed memory location
 Pointer<T> setCLongs(long[] values)
          Write an array of CLong values to the pointed memory location
 Pointer<T> setCLongsAtOffset(long byteOffset, CLong... values)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour setCLongs(CLong...) over this method.
 Pointer<T> setCLongsAtOffset(long byteOffset, int[] values)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour setCLongs(int[]) over this method.
 Pointer<T> setCLongsAtOffset(long byteOffset, long[] values)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour setCLongs(long[]) over this method.
 Pointer<T> setCLongsAtOffset(long byteOffset, long[] values, int valuesOffset, int length)
           
 Pointer<T> setCString(String s)
          Write a C string using the default charset to the pointed memory location (see Pointer.StringType.C).
 Pointer<T> setCStringAtOffset(long byteOffset, String s)
          Write a C string using the default charset to the pointed memory location shifted by a byte offset (see Pointer.StringType.C).
 Pointer<T> setDouble(double value)
          Write a double value to the pointed memory location
 Pointer<T> setDoubleAtOffset(long byteOffset, double value)
          Read a double value from the pointed memory location shifted by a byte offset
 Pointer<T> setDoubles(double[] values)
          Write an array of double values of the specified length to the pointed memory location
 Pointer<T> setDoubles(DoubleBuffer values)
          Write a buffer of double values of the specified length to the pointed memory location
 Pointer<T> setDoublesAtOffset(long byteOffset, double[] values)
          Write an array of double values of the specified length to the pointed memory location shifted by a byte offset
 Pointer<T> setDoublesAtOffset(long byteOffset, double[] values, int valuesOffset, int length)
          Write an array of double values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given array offset and for the given length from the provided array.
 Pointer<T> setDoublesAtOffset(long byteOffset, DoubleBuffer values)
          Write a buffer of double values of the specified length to the pointed memory location shifted by a byte offset
 Pointer<T> setDoublesAtOffset(long byteOffset, DoubleBuffer values, long valuesOffset, long length)
          Write a buffer of double values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given buffer offset and for the given length from the provided buffer.
 Pointer<T> setFloat(float value)
          Write a float value to the pointed memory location
 Pointer<T> setFloatAtOffset(long byteOffset, float value)
          Read a float value from the pointed memory location shifted by a byte offset
 Pointer<T> setFloats(float[] values)
          Write an array of float values of the specified length to the pointed memory location
 Pointer<T> setFloats(FloatBuffer values)
          Write a buffer of float values of the specified length to the pointed memory location
 Pointer<T> setFloatsAtOffset(long byteOffset, float[] values)
          Write an array of float values of the specified length to the pointed memory location shifted by a byte offset
 Pointer<T> setFloatsAtOffset(long byteOffset, float[] values, int valuesOffset, int length)
          Write an array of float values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given array offset and for the given length from the provided array.
 Pointer<T> setFloatsAtOffset(long byteOffset, FloatBuffer values)
          Write a buffer of float values of the specified length to the pointed memory location shifted by a byte offset
 Pointer<T> setFloatsAtOffset(long byteOffset, FloatBuffer values, long valuesOffset, long length)
          Write a buffer of float values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given buffer offset and for the given length from the provided buffer.
 Pointer<T> setInt(int value)
          Write a int value to the pointed memory location
 Pointer<T> setIntAtOffset(long byteOffset, int value)
          Read a int value from the pointed memory location shifted by a byte offset
 Pointer<T> setInts(int[] values)
          Write an array of int values of the specified length to the pointed memory location
 Pointer<T> setInts(IntBuffer values)
          Write a buffer of int values of the specified length to the pointed memory location
 Pointer<T> setIntsAtOffset(long byteOffset, int[] values)
          Write an array of int values of the specified length to the pointed memory location shifted by a byte offset
 Pointer<T> setIntsAtOffset(long byteOffset, int[] values, int valuesOffset, int length)
          Write an array of int values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given array offset and for the given length from the provided array.
 Pointer<T> setIntsAtOffset(long byteOffset, IntBuffer values)
          Write a buffer of int values of the specified length to the pointed memory location shifted by a byte offset
 Pointer<T> setIntsAtOffset(long byteOffset, IntBuffer values, long valuesOffset, long length)
          Write a buffer of int values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given buffer offset and for the given length from the provided buffer.
 Pointer<T> setLong(long value)
          Write a long value to the pointed memory location
 Pointer<T> setLongAtOffset(long byteOffset, long value)
          Read a long value from the pointed memory location shifted by a byte offset
 Pointer<T> setLongs(long[] values)
          Write an array of long values of the specified length to the pointed memory location
 Pointer<T> setLongs(LongBuffer values)
          Write a buffer of long values of the specified length to the pointed memory location
 Pointer<T> setLongsAtOffset(long byteOffset, long[] values)
          Write an array of long values of the specified length to the pointed memory location shifted by a byte offset
 Pointer<T> setLongsAtOffset(long byteOffset, long[] values, int valuesOffset, int length)
          Write an array of long values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given array offset and for the given length from the provided array.
 Pointer<T> setLongsAtOffset(long byteOffset, LongBuffer values)
          Write a buffer of long values of the specified length to the pointed memory location shifted by a byte offset
 Pointer<T> setLongsAtOffset(long byteOffset, LongBuffer values, long valuesOffset, long length)
          Write a buffer of long values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given buffer offset and for the given length from the provided buffer.
 Pointer<T> setPointer(Pointer<?> value)
          Write a pointer value to the pointed memory location
 Pointer<T> setPointerAtOffset(long byteOffset, Pointer<?> value)
          Write a pointer value to the pointed memory location shifted by a byte offset
 Pointer<T> setPointers(Pointer<?>[] values)
          Write an array of pointer values to the pointed memory location
 Pointer<T> setPointersAtOffset(long byteOffset, Pointer<?>[] values)
          Write an array of pointer values to the pointed memory location shifted by a byte offset
 Pointer<T> setPointersAtOffset(long byteOffset, Pointer<?>[] values, int valuesOffset, int length)
          Write length pointer values from the given array (starting at the given value offset) to the pointed memory location shifted by a byte offset
 Pointer<T> setShort(short value)
          Write a short value to the pointed memory location
 Pointer<T> setShortAtOffset(long byteOffset, short value)
          Read a short value from the pointed memory location shifted by a byte offset
 Pointer<T> setShorts(short[] values)
          Write an array of short values of the specified length to the pointed memory location
 Pointer<T> setShorts(ShortBuffer values)
          Write a buffer of short values of the specified length to the pointed memory location
 Pointer<T> setShortsAtOffset(long byteOffset, short[] values)
          Write an array of short values of the specified length to the pointed memory location shifted by a byte offset
 Pointer<T> setShortsAtOffset(long byteOffset, short[] values, int valuesOffset, int length)
          Write an array of short values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given array offset and for the given length from the provided array.
 Pointer<T> setShortsAtOffset(long byteOffset, ShortBuffer values)
          Write a buffer of short values of the specified length to the pointed memory location shifted by a byte offset
 Pointer<T> setShortsAtOffset(long byteOffset, ShortBuffer values, long valuesOffset, long length)
          Write a buffer of short values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given buffer offset and for the given length from the provided buffer.
 Pointer<T> setSizeT(long value)
          Write a SizeT value to the pointed memory location
 Pointer<T> setSizeT(SizeT value)
          Write a SizeT value to the pointed memory location
 Pointer<T> setSizeTAtOffset(long byteOffset, long value)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour setSizeT(long) over this method.
 Pointer<T> setSizeTAtOffset(long byteOffset, SizeT value)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour setSizeT(SizeT) over this method.
 Pointer<T> setSizeTs(int[] values)
          Write an array of SizeT values to the pointed memory location
 Pointer<T> setSizeTs(long[] values)
          Write an array of SizeT values to the pointed memory location
 Pointer<T> setSizeTs(SizeT[] values)
          Write an array of SizeT values to the pointed memory location
 Pointer<T> setSizeTsAtOffset(long byteOffset, int[] values)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour setSizeTs(int[]) over this method.
 Pointer<T> setSizeTsAtOffset(long byteOffset, long[] values)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour setSizeTs(long[]) over this method.
 Pointer<T> setSizeTsAtOffset(long byteOffset, long[] values, int valuesOffset, int length)
           
 Pointer<T> setSizeTsAtOffset(long byteOffset, SizeT... values)
          Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour setSizeTs(SizeT...) over this method.
 Pointer<T> setString(String s, Pointer.StringType type)
          Write a native string to the pointed memory location using the default charset.
 Pointer<T> setStringAtOffset(long byteOffset, String s, Pointer.StringType type, Charset charset)
          Write a native string to the pointed memory location shifted by a byte offset, using the provided charset or the system's default if not provided.
 Pointer<T> setValues(Buffer values)
          Copy values from an NIO buffer to the pointed memory location
 Pointer<T> setValuesAtOffset(long byteOffset, Buffer values)
          Copy all values from an NIO buffer to the pointed memory location shifted by a byte offset
 Pointer<T> setValuesAtOffset(long byteOffset, Buffer values, int valuesOffset, int length)
          Copy length values from an NIO buffer (beginning at element at valuesOffset index) to the pointed memory location shifted by a byte offset
 Pointer<T> setWideCString(String s)
          Write a WideC string using the default charset to the pointed memory location (see Pointer.StringType.WideC).
 Pointer<T> setWideCStringAtOffset(long byteOffset, String s)
          Write a WideC string using the default charset to the pointed memory location shifted by a byte offset (see Pointer.StringType.WideC).
 int size()
          Deprecated. Casts the result of getValidElements() to int, so sizes greater that 2^31 will be invalid
 List<T> subList(int fromIndex, int toIndex)
          Implementation of List.subList(int, int)
 T[] toArray()
          Implementation of List.toArray()
<U> U[]
toArray(U[] array)
          Implementation of List.toArray(Object[])
 void update(long index, T element)
          Alias for set(long, Object) defined for more natural use from the Scala language.
 void updateBuffer(Buffer buffer)
          When a pointer was created with pointerToBuffer(Buffer) on a non-direct buffer, a native copy of the buffer data was made.
 Pointer<T> validBytes(long byteCount)
          Creates a pointer that has the given number of valid bytes ahead.
 Pointer<T> validElements(long elementCount)
          Creates a pointer that has the given number of valid elements ahead.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL

public static final Pointer NULL
The NULL pointer is always Java's null value


SIZE

public static final int SIZE
Size of a pointer in bytes.
This is 4 bytes in a 32 bits environment and 8 bytes in a 64 bits environment.
Note that some 64 bits environments allow for 32 bits JVM execution (using the -d32 command line argument for Sun's JVM, for instance). In that case, Java programs will believe they're executed in a 32 bits environment.

Method Detail

pointerType

public static Type pointerType(Type targetType)
Create a Pointer<T> type.
For Instance, Pointer.pointerType(Integer.class) returns a type that represents Pointer<Integer>


intEnumType

public static <E extends Enum<E>> Type intEnumType(Class<? extends IntValuedEnum<E>> targetType)
Create a IntValuedEnum<T> type.
For Instance, Pointer.intEnumType(SomeEnum.class) returns a type that represents IntValuedEnum<SomeEnum>


release

public void release()
Manually release the memory pointed by this pointer if it was allocated on the Java side.
If the pointer is an offset version of another pointer (using offset(long) or next(long), for instance), this method tries to release the original pointer.
If the memory was not allocated from the Java side, this method does nothing either.
If the memory was already successfully released, this throws a RuntimeException.

Throws:
RuntimeException - if the pointer was already released

compareTo

public int compareTo(Pointer<?> p)
Compare to another pointer based on pointed addresses.

Specified by:
compareTo in interface Comparable<Pointer<?>>
Parameters:
p - other pointer
Returns:
1 if this pointer's address is greater than p's (or if p is null), -1 if the opposite is true, 0 if this and p point to the same memory location.

compareBytes

public int compareBytes(Pointer<?> other,
                        long byteCount)
Compare the byteCount bytes at the memory location pointed by this pointer to the byteCount bytes at the memory location pointer by other using the C @see memcmp function.

Returns:
0 if the two memory blocks are equal, -1 if this pointer's memory is "less" than the other and 1 otherwise.

compareBytesAtOffset

public int compareBytesAtOffset(long byteOffset,
                                Pointer<?> other,
                                long otherByteOffset,
                                long byteCount)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues)

Compare the byteCount bytes at the memory location pointed by this pointer shifted by byteOffset to the byteCount bytes at the memory location pointer by other shifted by otherByteOffset using the C @see memcmp function.

Returns:
0 if the two memory blocks are equal, -1 if this pointer's memory is "less" than the other and 1 otherwise.

hashCode

public int hashCode()
Compute a hash code based on pointed address.

Specified by:
hashCode in interface Collection<T>
Specified by:
hashCode in interface List<T>
Overrides:
hashCode in class Object

offset

public Pointer<T> offset(long byteOffset)
Returns a pointer which address value was obtained by this pointer's by adding a byte offset.
The returned pointer will prevent the memory associated to this pointer from being automatically reclaimed as long as it lives, unless Pointer.release() is called on the originally-allocated pointer.

Parameters:
byteOffset - offset in bytes of the new pointer vs. this pointer. The expression p.offset(byteOffset).getPeer() - p.getPeer() == byteOffset is always true.

validBytes

public Pointer<T> validBytes(long byteCount)
Creates a pointer that has the given number of valid bytes ahead.
If the pointer was already bound, the valid bytes must be lower or equal to the current getValidBytes() value.


validElements

public Pointer<T> validElements(long elementCount)
Creates a pointer that has the given number of valid elements ahead.
If the pointer was already bound, the valid bytes must be lower or equal to the current getValidElements() value.


getReference

public Pointer<Pointer<T>> getReference()
Returns a pointer to this pointer.
It will only succeed if this pointer was dereferenced from another pointer.
Let's take the following C++ code :
int** pp = ...;
        int* p = pp[10];
        int** ref = &p;
        ASSERT(pp == ref);
         
Here is its equivalent Java code :
Pointer<Pointer<Integer>> pp = ...;
        Pointer<Integer> p = pp.get(10);
        Pointer<Pointer<Integer>> ref = p.getReference();
        assert pp.equals(ref);
         


getPeer

public final long getPeer()
Get the address of the memory pointed to by this pointer ("cast this pointer to long", in C jargon).
This is equivalent to the C code (size_t)&pointer

Returns:
Address of the memory pointed to by this pointer

as

public <U> Pointer<U> as(PointerIO<U> newIO)
Cast this pointer to another pointer type

Parameters:
newIO -

order

public Pointer<T> order(ByteOrder order)
Create a clone of this pointer that has the byte order provided in argument, or return this if this pointer already uses the requested byte order.

Parameters:
order - byte order (endianness) of the returned pointer

order

public ByteOrder order()
Get the byte order (endianness) of this pointer.


getIO

public final PointerIO<T> getIO()
Get the PointerIO instance used by this pointer to get and set pointed values.


asPointerTo

public <U> Pointer<U> asPointerTo(Type type)
Cast this pointer to another pointer type
Synonym of as(Class)
The following C code :
T* pointerT = ...; U* pointerU = (U*)pointerT;
Can be translated to the following Java code :
Pointer<T> pointerT = ...; Pointer<U> pointerU = pointerT.as(U.class); // or pointerT.asPointerTo(U.class);

Type Parameters:
U - type of the elements pointed by the returned pointer
Parameters:
type - type of the elements pointed by the returned pointer
Returns:
pointer to type U elements at the same address as this pointer

as

public <U> Pointer<U> as(Class<U> type)
Cast this pointer to another pointer type.
Synonym of asPointerTo(Type)
The following C code :
T* pointerT = ...; U* pointerU = (U*)pointerT;
Can be translated to the following Java code :
Pointer<T> pointerT = ...; Pointer<U> pointerU = pointerT.as(U.class); // or pointerT.asPointerTo(U.class);

Type Parameters:
U - type of the elements pointed by the returned pointer
Parameters:
type - type of the elements pointed by the returned pointer
Returns:
pointer to type U elements at the same address as this pointer

asUntyped

public Pointer<?> asUntyped()
Cast this pointer to an untyped pointer.
Synonym of ptr.as((Class<?>)null).
See as(Class)
The following C code :
T* pointerT = ...; void* pointer = (void*)pointerT;
Can be translated to the following Java code :
Pointer<T> pointerT = ...; Pointer<?> pointer = pointerT.asUntyped(); // or pointerT.as((Class<?>)null);

Returns:
untyped pointer pointing to the same address as this pointer

getValidBytes

public long getValidBytes()
Get the amount of memory known to be valid from this pointer, or -1 if it is unknown.
Memory validity information is available when the pointer was created out of another pointer (with offset(long), next(), next(long)) or from a direct NIO buffer (pointerToBuffer(Buffer), pointerToInts(IntBuffer)...)

Returns:
amount of bytes that can be safely read or written from this pointer, or -1 if this amount is unknown

getValidElements

public long getValidElements()
Get the amount of memory known to be valid from this pointer (expressed in elements of the target type, see getTargetType()) or -1 if it is unknown.
Memory validity information is available when the pointer was created out of another pointer (with offset(long), next(), next(long)) or from a direct NIO buffer (pointerToBuffer(Buffer), pointerToInts(IntBuffer)...)

Returns:
amount of elements that can be safely read or written from this pointer, or -1 if this amount is unknown

iterator

public ListIterator<T> iterator()
Returns an iterator over the elements pointed by this pointer.
If this pointer was allocated from Java with the allocateXXX, pointerToXXX methods (or is a view or a clone of such a pointer), the iteration is safely bounded.
If this iterator is just a wrapper for a native-allocated pointer (or a view / clone of such a pointer), iteration will go forever (until illegal areas of memory are reached and cause a JVM crash).

Specified by:
iterator in interface Iterable<T>
Specified by:
iterator in interface Collection<T>
Specified by:
iterator in interface List<T>

pointerTo

public static <N extends NativeObject> Pointer<N> pointerTo(N instance)
Get a pointer to a native object (C++ or ObjectiveC class, struct, union, callback...)


pointerTo

public static <R extends NativeObject> Pointer<R> pointerTo(NativeObject instance,
                                                            Class<R> targetType)
Get a pointer to a native object, specifying the type of the pointer's target.
In C++, the address of the pointer to an object as its canonical class is not always the same as the address of the pointer to the same object cast to one of its parent classes.


getAddress

public static long getAddress(NativeObject instance,
                              Class targetType)
Get the address of a native object, specifying the type of the pointer's target (same as pointerTo(instance, targetType).getPeer(), see pointerTo(NativeObject, Class)).
In C++, the address of the pointer to an object as its canonical class is not always the same as the address of the pointer to the same object cast to one of its parent classes.


getNativeObjectAtOffset

public <O extends NativeObject> O getNativeObjectAtOffset(long byteOffset,
                                                          Type type)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getNativeObject(Type) over this method.

Read a native object value from the pointed memory location shifted by a byte offset


getNativeObjectAtOffset

public <O extends NativeObject> O getNativeObjectAtOffset(long byteOffset,
                                                          Class<O> type)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getNativeObject(Class) over this method.

Read a native object value from the pointed memory location shifted by a byte offset


getNativeObject

public <O extends NativeObject> O getNativeObject(Class<O> type)
Read a native object value from the pointed memory location


getNativeObject

public <O extends NativeObject> O getNativeObject(Type type)
Read a native object value from the pointed memory location


isAligned

public boolean isAligned()
Check that the pointer's peer is aligned to the target type alignment.

Returns:
getPeer() % alignment == 0
Throws:
RuntimeException - If the target type of this pointer is unknown

isAligned

public boolean isAligned(int alignment)
Check that the pointer's peer is aligned to the given alignment. If the pointer has no peer, this method returns true.

Returns:
getPeer() % alignment == 0

get

public T get()
Dereference this pointer (*ptr).
Take the following C++ code fragment :
int* array = new int[10];
     for (int index = 0; index < 10; index++, array++) 
        printf("%i\n", *array);
     
Here is its equivalent in Java :
import static org.bridj.Pointer.*;
     ...
     Pointer<Integer> array = allocateInts(10);
     for (int index = 0; index < 10; index++) { 
        System.out.println("%i\n".format(array.get()));
        array = array.next();
         }
     
Here is a simpler equivalent in Java :
import static org.bridj.Pointer.*;
     ...
     Pointer<Integer> array = allocateInts(10);
     for (int value : array) // array knows its size, so we can iterate on it
        System.out.println("%i\n".format(value));
     

Throws:
RuntimeException - if called on an untyped Pointer<?> instance (see getTargetType())

get

public T get(long index)
Gets the n-th element from this pointer.
This is equivalent to the C/C++ square bracket syntax.
Take the following C++ code fragment :
int* array = new int[10];
        int index = 5;
        int value = array[index];
     
Here is its equivalent in Java :
import static org.bridj.Pointer.*;
        ...
        Pointer<Integer> array = allocateInts(10);
        int index = 5;
        int value = array.get(index);
     

Parameters:
index - offset in pointed elements at which the value should be copied. Can be negative if the pointer was offset and the memory before it is valid.
Throws:
RuntimeException - if called on an untyped Pointer<?> instance (getTargetType())

set

public T set(T value)
Assign a value to the pointed memory location.
Take the following C++ code fragment :
int* array = new int[10];
        for (int index = 0; index < 10; index++, array++) { 
                int value = index;
array = value;
        }
     
Here is its equivalent in Java :
import static org.bridj.Pointer.*;
        ...
        Pointer<Integer> array = allocateInts(10);
        for (int index = 0; index < 10; index++) {
                int value = index;
                array.set(value);
                array = array.next();
        }
     

Throws:
RuntimeException - if called on an untyped Pointer<?> instance (getTargetType())

set

public T set(long index,
             T value)
Sets the n-th element from this pointer.
This is equivalent to the C/C++ square bracket assignment syntax.
Take the following C++ code fragment :
float* array = new float[10];
     int index = 5;
     float value = 12;
     array[index] = value;
     
Here is its equivalent in Java :
import static org.bridj.Pointer.*;
     ...
     Pointer<Float> array = allocateFloats(10);
     int index = 5;
     float value = 12;
     array.set(index, value);
     

Parameters:
index - offset in pointed elements at which the value should be copied. Can be negative if the pointer was offset and the memory before it is valid.
value - value to set at pointed memory location
Throws:
RuntimeException - if called on an untyped Pointer<?> instance (getTargetType())

getPeer

public static long getPeer(Pointer<?> pointer)
Get a pointer's peer (see getPeer()), or zero if the pointer is null.


getTargetSize

public long getTargetSize()
Get the unitary size of the pointed elements in bytes.

Throws:
RuntimeException - if the target type is unknown (see getTargetType())

next

public Pointer<T> next()
Returns a pointer to the next target. Same as incrementing a C pointer of delta elements, but creates a new pointer instance.

Returns:
next(1)

next

public Pointer<T> next(long delta)
Returns a pointer to the n-th next (or previous) target. Same as incrementing a C pointer of delta elements, but creates a new pointer instance.

Returns:
offset(getTargetSize() * delta)

release

public static void release(Pointer... pointers)
Release pointers, if they're not null (see release()).


equals

public boolean equals(Object obj)
Test equality of the pointer using the address.

Specified by:
equals in interface Collection<T>
Specified by:
equals in interface List<T>
Overrides:
equals in class Object
Returns:
true if and only if obj is a Pointer instance and obj.getPeer() == this.getPeer()

pointerToAddress

@Deprecated
public static Pointer<?> pointerToAddress(long peer)
Deprecated. 

Create a pointer out of a native memory address

Parameters:
peer - native memory address that is to be converted to a pointer
Returns:
a pointer with the provided address : pointer.getPeer() == address

pointerToAddress

@Deprecated
public static Pointer<?> pointerToAddress(long peer,
                                                     long size)
Deprecated. 

Create a pointer out of a native memory address

Parameters:
size - number of bytes known to be readable at the pointed address
peer - native memory address that is to be converted to a pointer
Returns:
a pointer with the provided address : pointer.getPeer() == peer

pointerToAddress

public static Pointer<?> pointerToAddress(long peer,
                                          Class<?> targetClass,
                                          Pointer.Releaser releaser)
Create a pointer out of a native memory address

Parameters:
targetClass - type of the elements pointed by the resulting pointer
releaser - object responsible for reclaiming the native memory once whenever the returned pointer is garbage-collected
peer - native memory address that is to be converted to a pointer
Returns:
a pointer with the provided address : pointer.getPeer() == peer

pointerToAddress

@Deprecated
public static Pointer<?> pointerToAddress(long peer,
                                                     Pointer.Releaser releaser)
Deprecated. 

Create a pointer out of a native memory address

Parameters:
releaser - object responsible for reclaiming the native memory once whenever the returned pointer is garbage-collected
peer - native memory address that is to be converted to a pointer
Returns:
a pointer with the provided address : pointer.getPeer() == peer

pointerToAddress

public static Pointer<?> pointerToAddress(long peer,
                                          long size,
                                          Pointer.Releaser releaser)
Create a pointer out of a native memory address

Parameters:
releaser - object responsible for reclaiming the native memory once whenever the returned pointer is garbage-collected
size - number of bytes known to be readable at the pointed address
peer - native memory address that is to be converted to a pointer
Returns:
a pointer with the provided address : pointer.getPeer() == peer

pointerToAddress

@Deprecated
public static <P> Pointer<P> pointerToAddress(long peer,
                                                         Class<P> targetClass)
Deprecated. 

Create a pointer out of a native memory address

Parameters:
targetClass - type of the elements pointed by the resulting pointer
peer - native memory address that is to be converted to a pointer
Returns:
a pointer with the provided address : pointer.getPeer() == peer

allocateTypedPointer

public static <P extends TypedPointer> Pointer<P> allocateTypedPointer(Class<P> type)
Allocate enough memory for a typed pointer value and return a pointer to it.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().

Returns:
pointer to a single zero-initialized typed pointer value

allocateTypedPointers

public static <P extends TypedPointer> Pointer<P> allocateTypedPointers(Class<P> type,
                                                                        long arrayLength)
Allocate enough memory for arrayLength typed pointer values and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<P extends TypedPointer> instance that can be safely iterated upon.

Returns:
pointer to arrayLength zero-initialized typed pointer consecutive values

allocatePointer

public static <P> Pointer<Pointer<P>> allocatePointer(Class<P> targetType)
Create a memory area large enough to hold a pointer.

Parameters:
targetType - target type of the pointer values to be stored in the allocated memory
Returns:
a pointer to a new memory area large enough to hold a single typed pointer

allocatePointer

public static <P> Pointer<Pointer<P>> allocatePointer(Type targetType)
Create a memory area large enough to hold a pointer.

Parameters:
targetType - target type of the pointer values to be stored in the allocated memory
Returns:
a pointer to a new memory area large enough to hold a single typed pointer

allocatePointerPointer

public static <P> Pointer<Pointer<Pointer<P>>> allocatePointerPointer(Type targetType)
Create a memory area large enough to hold a pointer to a pointer

Parameters:
targetType - target type of the values pointed by the pointer values to be stored in the allocated memory
Returns:
a pointer to a new memory area large enough to hold a single typed pointer

allocatePointerPointer

public static <P> Pointer<Pointer<Pointer<P>>> allocatePointerPointer(Class<P> targetType)
Create a memory area large enough to hold a pointer to a pointer

Parameters:
targetType - target type of the values pointed by the pointer values to be stored in the allocated memory
Returns:
a pointer to a new memory area large enough to hold a single typed pointer

allocatePointer

public static <V> Pointer<Pointer<?>> allocatePointer()
Create a memory area large enough to hold an untyped pointer.

Returns:
a pointer to a new memory area large enough to hold a single untyped pointer

allocatePointers

public static Pointer<Pointer<?>> allocatePointers(int arrayLength)
Allocate enough memory for arrayLength untyped pointer values and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<Pointer<?>> instance that can be safely iterated upon.

Returns:
pointer to arrayLength zero-initialized untyped pointer consecutive values

allocatePointers

public static <P> Pointer<Pointer<P>> allocatePointers(Class<P> targetType,
                                                       int arrayLength)
Create a memory area large enough to hold an array of arrayLength typed pointers.

Parameters:
targetType - target type of element pointers in the resulting pointer array.
arrayLength - size of the allocated array, in elements
Returns:
a pointer to a new memory area large enough to hold an array of arrayLength typed pointers

allocatePointers

public static <P> Pointer<Pointer<P>> allocatePointers(Type targetType,
                                                       int arrayLength)
Create a memory area large enough to hold an array of arrayLength typed pointers.

Parameters:
targetType - target type of element pointers in the resulting pointer array.
arrayLength - size of the allocated array, in elements
Returns:
a pointer to a new memory area large enough to hold an array of arrayLength typed pointers

allocate

public static <V> Pointer<V> allocate(Class<V> elementClass)
Create a memory area large enough to a single items of type elementClass.

Parameters:
elementClass - type of the array elements
Returns:
a pointer to a new memory area large enough to hold a single item of type elementClass.

allocate

public static <V> Pointer<V> allocate(PointerIO<V> io)
Create a memory area large enough to hold one item of the type associated to the provided PointerIO instance (see PointerIO.getTargetType())

Parameters:
io - PointerIO instance able to store and retrieve the element
Returns:
a pointer to a new memory area large enough to hold one item of the type associated to the provided PointerIO instance (see PointerIO.getTargetType())

allocateArray

public static <V> Pointer<V> allocateArray(PointerIO<V> io,
                                           long arrayLength)
Create a memory area large enough to hold arrayLength items of the type associated to the provided PointerIO instance (see PointerIO.getTargetType())

Parameters:
io - PointerIO instance able to store and retrieve elements of the array
arrayLength - length of the array in elements
Returns:
a pointer to a new memory area large enough to hold arrayLength items of the type associated to the provided PointerIO instance (see PointerIO.getTargetType())

allocateArray

public static <V> Pointer<V> allocateArray(PointerIO<V> io,
                                           long arrayLength,
                                           Pointer.Releaser beforeDeallocation)
Create a memory area large enough to hold arrayLength items of the type associated to the provided PointerIO instance (see PointerIO.getTargetType())

Parameters:
io - PointerIO instance able to store and retrieve elements of the array
arrayLength - length of the array in elements
beforeDeallocation - fake releaser that should be run just before the memory is actually released, for instance in order to call some object destructor
Returns:
a pointer to a new memory area large enough to hold arrayLength items of the type associated to the provided PointerIO instance (see PointerIO.getTargetType())

allocateBytes

public static <V> Pointer<V> allocateBytes(PointerIO<V> io,
                                           long byteSize,
                                           Pointer.Releaser beforeDeallocation)
Create a memory area large enough to hold byteSize consecutive bytes and return a pointer to elements of the type associated to the provided PointerIO instance (see PointerIO.getTargetType())

Parameters:
io - PointerIO instance able to store and retrieve elements of the array
byteSize - length of the array in bytes
beforeDeallocation - fake releaser that should be run just before the memory is actually released, for instance in order to call some object destructor
Returns:
a pointer to a new memory area large enough to hold byteSize consecutive bytes

allocateArray

public static <V> Pointer<V> allocateArray(Class<V> elementClass,
                                           long arrayLength)
Create a memory area large enough to hold arrayLength items of type elementClass.

Parameters:
elementClass - type of the array elements
arrayLength - length of the array in elements
Returns:
a pointer to a new memory area large enough to hold arrayLength items of type elementClass.

pointerToBuffer

public static Pointer<?> pointerToBuffer(Buffer buffer)
Create a pointer to the memory location used by a direct NIO buffer.
If the NIO buffer is not direct, then it's backing Java array is copied to some native memory and will never be updated by changes to the native memory (calls pointerToArray(Object)).
The returned pointer (and its subsequent clones returned by Object.clone(), offset(long) or next(long)) retains a reference to the original NIO buffer, so its lifespan is at least that of the pointer.

Throws:
UnsupportedOperationException - if the buffer is not direct

updateBuffer

public void updateBuffer(Buffer buffer)
When a pointer was created with pointerToBuffer(Buffer) on a non-direct buffer, a native copy of the buffer data was made. This method updates the original buffer with the native memory, and does nothing if the buffer is direct and points to the same memory location as this pointer.

Throws:
IllegalArgumentException - if buffer is direct and does not point to the exact same location as this Pointer instance

pointerToInt

public static Pointer<Integer> pointerToInt(int value)
Allocate enough memory for a single int value, copy the value provided in argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
value - initial value for the created memory location
Returns:
pointer to a new memory location that initially contains the int value given in argument

pointerToInts

public static Pointer<Integer> pointerToInts(int... values)
Allocate enough memory for values.length int values, copy the values provided as argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<Integer> instance that can be safely iterated upon :
for (float f : pointerTo(1f, 2f, 3.3f))
        System.out.println(f); 

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the int consecutive values provided in argument

pointerToInts

public static Pointer<Pointer<Integer>> pointerToInts(int[][] values)
Allocate enough memory for all the values in the 2D int array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
Assumes that all of the subarrays of the provided array are non null and have the same size.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the int values provided in argument packed as a 2D C array would be

pointerToInts

public static Pointer<Pointer<Pointer<Integer>>> pointerToInts(int[][][] values)
Allocate enough memory for all the values in the 3D int array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
Assumes that all of the subarrays of the provided array are non null and have the same size.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the int values provided in argument packed as a 3D C array would be

allocateInt

public static Pointer<Integer> allocateInt()
Allocate enough memory for a int value and return a pointer to it.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().

Returns:
pointer to a single zero-initialized int value

allocateInts

public static Pointer<Integer> allocateInts(long arrayLength)
Allocate enough memory for arrayLength int values and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<Integer> instance that can be safely iterated upon.

Returns:
pointer to arrayLength zero-initialized int consecutive values

allocateInts

public static Pointer<Pointer<Integer>> allocateInts(long dim1,
                                                     long dim2)
Allocate enough memory for dim1 * dim2 int values in a packed multi-dimensional C array and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Returns:
pointer to dim1 * dim2 zero-initialized int consecutive values

allocateInts

public static Pointer<Pointer<Pointer<Integer>>> allocateInts(long dim1,
                                                              long dim2,
                                                              long dim3)
Allocate enough memory for dim1 * dim2 * dim3 int values in a packed multi-dimensional C array and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Returns:
pointer to dim1 * dim2 * dim3 zero-initialized int consecutive values

pointerToLong

public static Pointer<Long> pointerToLong(long value)
Allocate enough memory for a single long value, copy the value provided in argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
value - initial value for the created memory location
Returns:
pointer to a new memory location that initially contains the long value given in argument

pointerToLongs

public static Pointer<Long> pointerToLongs(long... values)
Allocate enough memory for values.length long values, copy the values provided as argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<Long> instance that can be safely iterated upon :
for (float f : pointerTo(1f, 2f, 3.3f))
        System.out.println(f); 

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the long consecutive values provided in argument

pointerToLongs

public static Pointer<Pointer<Long>> pointerToLongs(long[][] values)
Allocate enough memory for all the values in the 2D long array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
Assumes that all of the subarrays of the provided array are non null and have the same size.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the long values provided in argument packed as a 2D C array would be

pointerToLongs

public static Pointer<Pointer<Pointer<Long>>> pointerToLongs(long[][][] values)
Allocate enough memory for all the values in the 3D long array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
Assumes that all of the subarrays of the provided array are non null and have the same size.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the long values provided in argument packed as a 3D C array would be

allocateLong

public static Pointer<Long> allocateLong()
Allocate enough memory for a long value and return a pointer to it.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().

Returns:
pointer to a single zero-initialized long value

allocateLongs

public static Pointer<Long> allocateLongs(long arrayLength)
Allocate enough memory for arrayLength long values and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<Long> instance that can be safely iterated upon.

Returns:
pointer to arrayLength zero-initialized long consecutive values

allocateLongs

public static Pointer<Pointer<Long>> allocateLongs(long dim1,
                                                   long dim2)
Allocate enough memory for dim1 * dim2 long values in a packed multi-dimensional C array and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Returns:
pointer to dim1 * dim2 zero-initialized long consecutive values

allocateLongs

public static Pointer<Pointer<Pointer<Long>>> allocateLongs(long dim1,
                                                            long dim2,
                                                            long dim3)
Allocate enough memory for dim1 * dim2 * dim3 long values in a packed multi-dimensional C array and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Returns:
pointer to dim1 * dim2 * dim3 zero-initialized long consecutive values

pointerToShort

public static Pointer<Short> pointerToShort(short value)
Allocate enough memory for a single short value, copy the value provided in argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
value - initial value for the created memory location
Returns:
pointer to a new memory location that initially contains the short value given in argument

pointerToShorts

public static Pointer<Short> pointerToShorts(short... values)
Allocate enough memory for values.length short values, copy the values provided as argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<Short> instance that can be safely iterated upon :
for (float f : pointerTo(1f, 2f, 3.3f))
        System.out.println(f); 

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the short consecutive values provided in argument

pointerToShorts

public static Pointer<Pointer<Short>> pointerToShorts(short[][] values)
Allocate enough memory for all the values in the 2D short array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
Assumes that all of the subarrays of the provided array are non null and have the same size.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the short values provided in argument packed as a 2D C array would be

pointerToShorts

public static Pointer<Pointer<Pointer<Short>>> pointerToShorts(short[][][] values)
Allocate enough memory for all the values in the 3D short array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
Assumes that all of the subarrays of the provided array are non null and have the same size.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the short values provided in argument packed as a 3D C array would be

allocateShort

public static Pointer<Short> allocateShort()
Allocate enough memory for a short value and return a pointer to it.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().

Returns:
pointer to a single zero-initialized short value

allocateShorts

public static Pointer<Short> allocateShorts(long arrayLength)
Allocate enough memory for arrayLength short values and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<Short> instance that can be safely iterated upon.

Returns:
pointer to arrayLength zero-initialized short consecutive values

allocateShorts

public static Pointer<Pointer<Short>> allocateShorts(long dim1,
                                                     long dim2)
Allocate enough memory for dim1 * dim2 short values in a packed multi-dimensional C array and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Returns:
pointer to dim1 * dim2 zero-initialized short consecutive values

allocateShorts

public static Pointer<Pointer<Pointer<Short>>> allocateShorts(long dim1,
                                                              long dim2,
                                                              long dim3)
Allocate enough memory for dim1 * dim2 * dim3 short values in a packed multi-dimensional C array and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Returns:
pointer to dim1 * dim2 * dim3 zero-initialized short consecutive values

pointerToByte

public static Pointer<Byte> pointerToByte(byte value)
Allocate enough memory for a single byte value, copy the value provided in argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
value - initial value for the created memory location
Returns:
pointer to a new memory location that initially contains the byte value given in argument

pointerToBytes

public static Pointer<Byte> pointerToBytes(byte... values)
Allocate enough memory for values.length byte values, copy the values provided as argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<Byte> instance that can be safely iterated upon :
for (float f : pointerTo(1f, 2f, 3.3f))
        System.out.println(f); 

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the byte consecutive values provided in argument

pointerToBytes

public static Pointer<Pointer<Byte>> pointerToBytes(byte[][] values)
Allocate enough memory for all the values in the 2D byte array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
Assumes that all of the subarrays of the provided array are non null and have the same size.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the byte values provided in argument packed as a 2D C array would be

pointerToBytes

public static Pointer<Pointer<Pointer<Byte>>> pointerToBytes(byte[][][] values)
Allocate enough memory for all the values in the 3D byte array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
Assumes that all of the subarrays of the provided array are non null and have the same size.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the byte values provided in argument packed as a 3D C array would be

allocateByte

public static Pointer<Byte> allocateByte()
Allocate enough memory for a byte value and return a pointer to it.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().

Returns:
pointer to a single zero-initialized byte value

allocateBytes

public static Pointer<Byte> allocateBytes(long arrayLength)
Allocate enough memory for arrayLength byte values and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<Byte> instance that can be safely iterated upon.

Returns:
pointer to arrayLength zero-initialized byte consecutive values

allocateBytes

public static Pointer<Pointer<Byte>> allocateBytes(long dim1,
                                                   long dim2)
Allocate enough memory for dim1 * dim2 byte values in a packed multi-dimensional C array and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Returns:
pointer to dim1 * dim2 zero-initialized byte consecutive values

allocateBytes

public static Pointer<Pointer<Pointer<Byte>>> allocateBytes(long dim1,
                                                            long dim2,
                                                            long dim3)
Allocate enough memory for dim1 * dim2 * dim3 byte values in a packed multi-dimensional C array and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Returns:
pointer to dim1 * dim2 * dim3 zero-initialized byte consecutive values

pointerToChar

public static Pointer<Character> pointerToChar(char value)
Allocate enough memory for a single char value, copy the value provided in argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
value - initial value for the created memory location
Returns:
pointer to a new memory location that initially contains the char value given in argument

pointerToChars

public static Pointer<Character> pointerToChars(char... values)
Allocate enough memory for values.length char values, copy the values provided as argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<Character> instance that can be safely iterated upon :
for (float f : pointerTo(1f, 2f, 3.3f))
        System.out.println(f); 

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the char consecutive values provided in argument

pointerToChars

public static Pointer<Pointer<Character>> pointerToChars(char[][] values)
Allocate enough memory for all the values in the 2D char array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
Assumes that all of the subarrays of the provided array are non null and have the same size.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the char values provided in argument packed as a 2D C array would be

pointerToChars

public static Pointer<Pointer<Pointer<Character>>> pointerToChars(char[][][] values)
Allocate enough memory for all the values in the 3D char array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
Assumes that all of the subarrays of the provided array are non null and have the same size.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the char values provided in argument packed as a 3D C array would be

allocateChar

public static Pointer<Character> allocateChar()
Allocate enough memory for a char value and return a pointer to it.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().

Returns:
pointer to a single zero-initialized char value

allocateChars

public static Pointer<Character> allocateChars(long arrayLength)
Allocate enough memory for arrayLength char values and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<Character> instance that can be safely iterated upon.

Returns:
pointer to arrayLength zero-initialized char consecutive values

allocateChars

public static Pointer<Pointer<Character>> allocateChars(long dim1,
                                                        long dim2)
Allocate enough memory for dim1 * dim2 char values in a packed multi-dimensional C array and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Returns:
pointer to dim1 * dim2 zero-initialized char consecutive values

allocateChars

public static Pointer<Pointer<Pointer<Character>>> allocateChars(long dim1,
                                                                 long dim2,
                                                                 long dim3)
Allocate enough memory for dim1 * dim2 * dim3 char values in a packed multi-dimensional C array and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Returns:
pointer to dim1 * dim2 * dim3 zero-initialized char consecutive values

pointerToFloat

public static Pointer<Float> pointerToFloat(float value)
Allocate enough memory for a single float value, copy the value provided in argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
value - initial value for the created memory location
Returns:
pointer to a new memory location that initially contains the float value given in argument

pointerToFloats

public static Pointer<Float> pointerToFloats(float... values)
Allocate enough memory for values.length float values, copy the values provided as argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<Float> instance that can be safely iterated upon :
for (float f : pointerTo(1f, 2f, 3.3f))
        System.out.println(f); 

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the float consecutive values provided in argument

pointerToFloats

public static Pointer<Pointer<Float>> pointerToFloats(float[][] values)
Allocate enough memory for all the values in the 2D float array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
Assumes that all of the subarrays of the provided array are non null and have the same size.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the float values provided in argument packed as a 2D C array would be

pointerToFloats

public static Pointer<Pointer<Pointer<Float>>> pointerToFloats(float[][][] values)
Allocate enough memory for all the values in the 3D float array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
Assumes that all of the subarrays of the provided array are non null and have the same size.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the float values provided in argument packed as a 3D C array would be

allocateFloat

public static Pointer<Float> allocateFloat()
Allocate enough memory for a float value and return a pointer to it.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().

Returns:
pointer to a single zero-initialized float value

allocateFloats

public static Pointer<Float> allocateFloats(long arrayLength)
Allocate enough memory for arrayLength float values and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<Float> instance that can be safely iterated upon.

Returns:
pointer to arrayLength zero-initialized float consecutive values

allocateFloats

public static Pointer<Pointer<Float>> allocateFloats(long dim1,
                                                     long dim2)
Allocate enough memory for dim1 * dim2 float values in a packed multi-dimensional C array and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Returns:
pointer to dim1 * dim2 zero-initialized float consecutive values

allocateFloats

public static Pointer<Pointer<Pointer<Float>>> allocateFloats(long dim1,
                                                              long dim2,
                                                              long dim3)
Allocate enough memory for dim1 * dim2 * dim3 float values in a packed multi-dimensional C array and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Returns:
pointer to dim1 * dim2 * dim3 zero-initialized float consecutive values

pointerToDouble

public static Pointer<Double> pointerToDouble(double value)
Allocate enough memory for a single double value, copy the value provided in argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
value - initial value for the created memory location
Returns:
pointer to a new memory location that initially contains the double value given in argument

pointerToDoubles

public static Pointer<Double> pointerToDoubles(double... values)
Allocate enough memory for values.length double values, copy the values provided as argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<Double> instance that can be safely iterated upon :
for (float f : pointerTo(1f, 2f, 3.3f))
        System.out.println(f); 

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the double consecutive values provided in argument

pointerToDoubles

public static Pointer<Pointer<Double>> pointerToDoubles(double[][] values)
Allocate enough memory for all the values in the 2D double array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
Assumes that all of the subarrays of the provided array are non null and have the same size.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the double values provided in argument packed as a 2D C array would be

pointerToDoubles

public static Pointer<Pointer<Pointer<Double>>> pointerToDoubles(double[][][] values)
Allocate enough memory for all the values in the 3D double array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
Assumes that all of the subarrays of the provided array are non null and have the same size.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the double values provided in argument packed as a 3D C array would be

allocateDouble

public static Pointer<Double> allocateDouble()
Allocate enough memory for a double value and return a pointer to it.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().

Returns:
pointer to a single zero-initialized double value

allocateDoubles

public static Pointer<Double> allocateDoubles(long arrayLength)
Allocate enough memory for arrayLength double values and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<Double> instance that can be safely iterated upon.

Returns:
pointer to arrayLength zero-initialized double consecutive values

allocateDoubles

public static Pointer<Pointer<Double>> allocateDoubles(long dim1,
                                                       long dim2)
Allocate enough memory for dim1 * dim2 double values in a packed multi-dimensional C array and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Returns:
pointer to dim1 * dim2 zero-initialized double consecutive values

allocateDoubles

public static Pointer<Pointer<Pointer<Double>>> allocateDoubles(long dim1,
                                                                long dim2,
                                                                long dim3)
Allocate enough memory for dim1 * dim2 * dim3 double values in a packed multi-dimensional C array and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Returns:
pointer to dim1 * dim2 * dim3 zero-initialized double consecutive values

pointerToBoolean

public static Pointer<Boolean> pointerToBoolean(boolean value)
Allocate enough memory for a single boolean value, copy the value provided in argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
value - initial value for the created memory location
Returns:
pointer to a new memory location that initially contains the boolean value given in argument

pointerToBooleans

public static Pointer<Boolean> pointerToBooleans(boolean... values)
Allocate enough memory for values.length boolean values, copy the values provided as argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<Boolean> instance that can be safely iterated upon :
for (float f : pointerTo(1f, 2f, 3.3f))
        System.out.println(f); 

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the boolean consecutive values provided in argument

pointerToBooleans

public static Pointer<Pointer<Boolean>> pointerToBooleans(boolean[][] values)
Allocate enough memory for all the values in the 2D boolean array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
Assumes that all of the subarrays of the provided array are non null and have the same size.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the boolean values provided in argument packed as a 2D C array would be

pointerToBooleans

public static Pointer<Pointer<Pointer<Boolean>>> pointerToBooleans(boolean[][][] values)
Allocate enough memory for all the values in the 3D boolean array, copy the values provided as argument into it as packed multi-dimensional C array and return a pointer to that memory.
Assumes that all of the subarrays of the provided array are non null and have the same size.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the boolean values provided in argument packed as a 3D C array would be

allocateBoolean

public static Pointer<Boolean> allocateBoolean()
Allocate enough memory for a boolean value and return a pointer to it.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().

Returns:
pointer to a single zero-initialized boolean value

allocateBooleans

public static Pointer<Boolean> allocateBooleans(long arrayLength)
Allocate enough memory for arrayLength boolean values and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<Boolean> instance that can be safely iterated upon.

Returns:
pointer to arrayLength zero-initialized boolean consecutive values

allocateBooleans

public static Pointer<Pointer<Boolean>> allocateBooleans(long dim1,
                                                         long dim2)
Allocate enough memory for dim1 * dim2 boolean values in a packed multi-dimensional C array and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Returns:
pointer to dim1 * dim2 zero-initialized boolean consecutive values

allocateBooleans

public static Pointer<Pointer<Pointer<Boolean>>> allocateBooleans(long dim1,
                                                                  long dim2,
                                                                  long dim3)
Allocate enough memory for dim1 * dim2 * dim3 boolean values in a packed multi-dimensional C array and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Returns:
pointer to dim1 * dim2 * dim3 zero-initialized boolean consecutive values

pointerToInts

public static Pointer<Integer> pointerToInts(IntBuffer buffer)
Create a pointer to the memory location used by a direct NIO IntBuffer}.
If the NIO IntBuffer} is not direct, then it's backing Java array is copied to some native memory and will never be updated by changes to the native memory (calls pointerToInts(int[])).
The returned pointer (and its subsequent clones returned by Object.clone(), offset(long) or next(long)) retains a reference to the original NIO buffer, so its lifespan is at least that of the pointer.

Throws:
UnsupportedOperationException - if the buffer is not direct

pointerToLongs

public static Pointer<Long> pointerToLongs(LongBuffer buffer)
Create a pointer to the memory location used by a direct NIO LongBuffer}.
If the NIO LongBuffer} is not direct, then it's backing Java array is copied to some native memory and will never be updated by changes to the native memory (calls pointerToLongs(long[])).
The returned pointer (and its subsequent clones returned by Object.clone(), offset(long) or next(long)) retains a reference to the original NIO buffer, so its lifespan is at least that of the pointer.

Throws:
UnsupportedOperationException - if the buffer is not direct

pointerToShorts

public static Pointer<Short> pointerToShorts(ShortBuffer buffer)
Create a pointer to the memory location used by a direct NIO ShortBuffer}.
If the NIO ShortBuffer} is not direct, then it's backing Java array is copied to some native memory and will never be updated by changes to the native memory (calls pointerToShorts(short[])).
The returned pointer (and its subsequent clones returned by Object.clone(), offset(long) or next(long)) retains a reference to the original NIO buffer, so its lifespan is at least that of the pointer.

Throws:
UnsupportedOperationException - if the buffer is not direct

pointerToBytes

public static Pointer<Byte> pointerToBytes(ByteBuffer buffer)
Create a pointer to the memory location used by a direct NIO ByteBuffer}.
If the NIO ByteBuffer} is not direct, then it's backing Java array is copied to some native memory and will never be updated by changes to the native memory (calls pointerToBytes(byte[])).
The returned pointer (and its subsequent clones returned by Object.clone(), offset(long) or next(long)) retains a reference to the original NIO buffer, so its lifespan is at least that of the pointer.

Throws:
UnsupportedOperationException - if the buffer is not direct

pointerToChars

public static Pointer<Character> pointerToChars(CharBuffer buffer)
Create a pointer to the memory location used by a direct NIO CharBuffer}.
If the NIO CharBuffer} is not direct, then it's backing Java array is copied to some native memory and will never be updated by changes to the native memory (calls pointerToChars(char[])).
The returned pointer (and its subsequent clones returned by Object.clone(), offset(long) or next(long)) retains a reference to the original NIO buffer, so its lifespan is at least that of the pointer.

Throws:
UnsupportedOperationException - if the buffer is not direct

pointerToFloats

public static Pointer<Float> pointerToFloats(FloatBuffer buffer)
Create a pointer to the memory location used by a direct NIO FloatBuffer}.
If the NIO FloatBuffer} is not direct, then it's backing Java array is copied to some native memory and will never be updated by changes to the native memory (calls pointerToFloats(float[])).
The returned pointer (and its subsequent clones returned by Object.clone(), offset(long) or next(long)) retains a reference to the original NIO buffer, so its lifespan is at least that of the pointer.

Throws:
UnsupportedOperationException - if the buffer is not direct

pointerToDoubles

public static Pointer<Double> pointerToDoubles(DoubleBuffer buffer)
Create a pointer to the memory location used by a direct NIO DoubleBuffer}.
If the NIO DoubleBuffer} is not direct, then it's backing Java array is copied to some native memory and will never be updated by changes to the native memory (calls pointerToDoubles(double[])).
The returned pointer (and its subsequent clones returned by Object.clone(), offset(long) or next(long)) retains a reference to the original NIO buffer, so its lifespan is at least that of the pointer.

Throws:
UnsupportedOperationException - if the buffer is not direct

getTargetType

public Type getTargetType()
Get the type of pointed elements.


getPointer

@Deprecated
public Pointer<?> getPointer()
Deprecated. Avoid using untyped pointers, if possible.

Read an untyped pointer value from the pointed memory location


getPointerAtOffset

public Pointer<?> getPointerAtOffset(long byteOffset)
Read a pointer value from the pointed memory location shifted by a byte offset


getPointer

public <U> Pointer<U> getPointer(Class<U> c)
Read a pointer value from the pointed memory location.

Parameters:
c - class of the elements pointed by the resulting pointer

getPointer

public <U> Pointer<U> getPointer(PointerIO<U> pio)
Read a pointer value from the pointed memory location

Parameters:
pio - PointerIO instance that knows how to read the elements pointed by the resulting pointer

getPointerAtOffset

public <U> Pointer<U> getPointerAtOffset(long byteOffset,
                                         Class<U> c)
Read a pointer value from the pointed memory location shifted by a byte offset

Parameters:
c - class of the elements pointed by the resulting pointer

getPointerAtOffset

public <U> Pointer<U> getPointerAtOffset(long byteOffset,
                                         Type t)
Read a pointer value from the pointed memory location shifted by a byte offset

Parameters:
t - type of the elements pointed by the resulting pointer

getPointerAtOffset

public <U> Pointer<U> getPointerAtOffset(long byteOffset,
                                         PointerIO<U> pio)
Read a pointer value from the pointed memory location shifted by a byte offset

Parameters:
pio - PointerIO instance that knows how to read the elements pointed by the resulting pointer

setPointer

public Pointer<T> setPointer(Pointer<?> value)
Write a pointer value to the pointed memory location


setPointerAtOffset

public Pointer<T> setPointerAtOffset(long byteOffset,
                                     Pointer<?> value)
Write a pointer value to the pointed memory location shifted by a byte offset


getPointersAtOffset

public Pointer<?>[] getPointersAtOffset(long byteOffset,
                                        int arrayLength)
Deprecated. Use a typed version instead : getPointersAtOffset(long, int, Type), Pointer#getPointers(long, int, Class) or getPointersAtOffset(long, int, PointerIO)

Read an array of untyped pointer values from the pointed memory location shifted by a byte offset


getPointers

@Deprecated
public Pointer<?>[] getPointers()
Deprecated. Use a typed version instead : getPointersAtOffset(long, int, Type), Pointer#getPointers(long, int, Class) or getPointersAtOffset(long, int, PointerIO)

Read the array of remaining untyped pointer values from the pointed memory location


getPointers

@Deprecated
public Pointer<?>[] getPointers(int arrayLength)
Deprecated. Use a typed version instead : getPointersAtOffset(long, int, Type), Pointer#getPointers(long, int, Class) or getPointersAtOffset(long, int, PointerIO)

Read an array of untyped pointer values from the pointed memory location


getPointersAtOffset

public <U> Pointer<U>[] getPointersAtOffset(long byteOffset,
                                            int arrayLength,
                                            Type t)
Read an array of pointer values from the pointed memory location shifted by a byte offset

Parameters:
t - type of the elements pointed by the resulting pointer

getPointersAtOffset

public <U> Pointer<U>[] getPointersAtOffset(long byteOffset,
                                            int arrayLength,
                                            Class<U> t)
Read an array of pointer values from the pointed memory location shifted by a byte offset

Parameters:
t - class of the elements pointed by the resulting pointer

getPointersAtOffset

public <U> Pointer<U>[] getPointersAtOffset(long byteOffset,
                                            int arrayLength,
                                            PointerIO pio)
Read an array of pointer values from the pointed memory location shifted by a byte offset

Parameters:
pio - PointerIO instance that knows how to read the elements pointed by the resulting pointer

setPointersAtOffset

public Pointer<T> setPointersAtOffset(long byteOffset,
                                      Pointer<?>[] values)
Write an array of pointer values to the pointed memory location shifted by a byte offset


setPointersAtOffset

public Pointer<T> setPointersAtOffset(long byteOffset,
                                      Pointer<?>[] values,
                                      int valuesOffset,
                                      int length)
Write length pointer values from the given array (starting at the given value offset) to the pointed memory location shifted by a byte offset


setPointers

public Pointer<T> setPointers(Pointer<?>[] values)
Write an array of pointer values to the pointed memory location


getArrayAtOffset

public Object getArrayAtOffset(long byteOffset,
                               int length)
Read an array of elements from the pointed memory location shifted by a byte offset.
For pointers to primitive types (e.g. Pointer<Integer> ), this method returns primitive arrays (e.g. int[] ), unlike toArray() (which returns arrays of objects so primitives end up being boxed, e.g. Integer[] )

Returns:
an array of values of the requested length. The array is an array of primitives if the pointer's target type is a primitive or a boxed primitive type

getArray

public Object getArray(int length)
Read an array of elements from the pointed memory location.
For pointers to primitive types (e.g. Pointer<Integer> ), this method returns primitive arrays (e.g. int[] ), unlike toArray() (which returns arrays of objects so primitives end up being boxed, e.g. Integer[] )

Returns:
an array of values of the requested length. The array is an array of primitives if the pointer's target type is a primitive or a boxed primitive type

getArray

public Object getArray()
Read the array of remaining elements from the pointed memory location.
For pointers to primitive types (e.g. Pointer<Integer> ), this method returns primitive arrays (e.g. int[] ), unlike toArray() (which returns arrays of objects so primitives end up being boxed, e.g. Integer[] )

Returns:
an array of values of the requested length. The array is an array of primitives if the pointer's target type is a primitive or a boxed primitive type

getBufferAtOffset

public <B extends Buffer> B getBufferAtOffset(long byteOffset,
                                              int length)
Read an NIO Buffer of elements from the pointed memory location shifted by a byte offset.

Returns:
an NIO Buffer of values of the requested length.
Throws:
UnsupportedOperationException - if this pointer's target type is not a Java primitive type with a corresponding NIO Buffer class.

getBuffer

public <B extends Buffer> B getBuffer(int length)
Read an NIO Buffer of elements from the pointed memory location.

Returns:
an NIO Buffer of values of the requested length.
Throws:
UnsupportedOperationException - if this pointer's target type is not a Java primitive type with a corresponding NIO Buffer class.

getBuffer

public <B extends Buffer> B getBuffer()
Read the NIO Buffer of remaining elements from the pointed memory location.

Returns:
an array of values of the requested length.
Throws:
UnsupportedOperationException - if this pointer's target type is not a Java primitive type with a corresponding NIO Buffer class.

setArrayAtOffset

public Pointer<T> setArrayAtOffset(long byteOffset,
                                   Object array)
Write an array of elements to the pointed memory location shifted by a byte offset.
For pointers to primitive types (e.g. Pointer<Integer> ), this method accepts primitive arrays (e.g. int[] ) instead of arrays of boxed primitives (e.g. Integer[] )


pointerToArray

public static <T> Pointer<T> pointerToArray(Object array)
Allocate enough memory for array.length values, copy the values of the array provided as argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
For pointers to primitive types (e.g. Pointer<Integer> ), this method accepts primitive arrays (e.g. int[] ) instead of arrays of boxed primitives (e.g. Integer[] )

Parameters:
array - primitive array containing the initial values for the created memory area
Returns:
pointer to a new memory location that initially contains the consecutive values provided in argument

setArray

public Pointer<T> setArray(Object array)
Write an array of elements to the pointed memory location.
For pointers to primitive types (e.g. Pointer<Integer> ), this method accepts primitive arrays (e.g. int[] ) instead of arrays of boxed primitives (e.g. Integer[] )


pointerToSizeT

public static Pointer<SizeT> pointerToSizeT(long value)
Allocate enough memory for a single SizeT value, copy the value provided in argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
value - initial value for the created memory location
Returns:
pointer to a new memory location that initially contains the SizeT value given in argument

pointerToSizeT

public static Pointer<SizeT> pointerToSizeT(SizeT value)
Allocate enough memory for a single SizeT value, copy the value provided in argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
value - initial value for the created memory location
Returns:
pointer to a new memory location that initially contains the SizeT value given in argument

pointerToSizeTs

public static Pointer<SizeT> pointerToSizeTs(long... values)
Allocate enough memory for values.length SizeT values, copy the values provided as argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<SizeT> instance that can be safely iterated upon :
for (float f : pointerTo(1f, 2f, 3.3f))
        System.out.println(f); 

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the SizeT consecutive values provided in argument

pointerToSizeTs

public static Pointer<SizeT> pointerToSizeTs(SizeT... values)
Allocate enough memory for values.length SizeT values, copy the values provided as argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<SizeT> instance that can be safely iterated upon :
for (float f : pointerTo(1f, 2f, 3.3f))
        System.out.println(f); 

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the SizeT consecutive values provided in argument

pointerToSizeTs

public static Pointer<SizeT> pointerToSizeTs(int[] values)
Allocate enough memory for values.length SizeT values, copy the values provided as argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<SizeT> instance that can be safely iterated upon :
for (float f : pointerTo(1f, 2f, 3.3f))
        System.out.println(f); 

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the SizeT consecutive values provided in argument

allocateSizeTs

public static Pointer<SizeT> allocateSizeTs(long arrayLength)
Allocate enough memory for arrayLength SizeT values and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<SizeT> instance that can be safely iterated upon.

Returns:
pointer to arrayLength zero-initialized SizeT consecutive values

allocateSizeT

public static Pointer<SizeT> allocateSizeT()
Allocate enough memory for a SizeT value and return a pointer to it.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().

Returns:
pointer to a single zero-initialized SizeT value

getSizeT

public long getSizeT()
Read a SizeT value from the pointed memory location


getSizeTAtOffset

public long getSizeTAtOffset(long byteOffset)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getSizeT() over this method.

Read a SizeT value from the pointed memory location shifted by a byte offset


getSizeTs

public long[] getSizeTs()
Read the array of remaining SizeT values from the pointed memory location


getSizeTs

public long[] getSizeTs(int arrayLength)
Read an array of SizeT values of the specified length from the pointed memory location


getSizeTsAtOffset

public long[] getSizeTsAtOffset(long byteOffset,
                                int arrayLength)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getSizeTs(int) over this method.

Read an array of SizeT values of the specified length from the pointed memory location shifted by a byte offset


setSizeT

public Pointer<T> setSizeT(long value)
Write a SizeT value to the pointed memory location


setSizeT

public Pointer<T> setSizeT(SizeT value)
Write a SizeT value to the pointed memory location


setSizeTAtOffset

public Pointer<T> setSizeTAtOffset(long byteOffset,
                                   long value)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour setSizeT(long) over this method.

Write a SizeT value to the pointed memory location shifted by a byte offset


setSizeTAtOffset

public Pointer<T> setSizeTAtOffset(long byteOffset,
                                   SizeT value)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour setSizeT(SizeT) over this method.

Write a SizeT value to the pointed memory location shifted by a byte offset


setSizeTs

public Pointer<T> setSizeTs(long[] values)
Write an array of SizeT values to the pointed memory location


setSizeTs

public Pointer<T> setSizeTs(int[] values)
Write an array of SizeT values to the pointed memory location


setSizeTs

public Pointer<T> setSizeTs(SizeT[] values)
Write an array of SizeT values to the pointed memory location


setSizeTsAtOffset

public Pointer<T> setSizeTsAtOffset(long byteOffset,
                                    long[] values)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour setSizeTs(long[]) over this method.

Write an array of SizeT values to the pointed memory location shifted by a byte offset


setSizeTsAtOffset

public Pointer<T> setSizeTsAtOffset(long byteOffset,
                                    long[] values,
                                    int valuesOffset,
                                    int length)

setSizeTsAtOffset

public Pointer<T> setSizeTsAtOffset(long byteOffset,
                                    SizeT... values)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour setSizeTs(SizeT...) over this method.

Write an array of SizeT values to the pointed memory location shifted by a byte offset


setSizeTsAtOffset

public Pointer<T> setSizeTsAtOffset(long byteOffset,
                                    int[] values)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour setSizeTs(int[]) over this method.

Write an array of SizeT values to the pointed memory location shifted by a byte offset


pointerToCLong

public static Pointer<CLong> pointerToCLong(long value)
Allocate enough memory for a single CLong value, copy the value provided in argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
value - initial value for the created memory location
Returns:
pointer to a new memory location that initially contains the CLong value given in argument

pointerToCLong

public static Pointer<CLong> pointerToCLong(CLong value)
Allocate enough memory for a single CLong value, copy the value provided in argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
value - initial value for the created memory location
Returns:
pointer to a new memory location that initially contains the CLong value given in argument

pointerToCLongs

public static Pointer<CLong> pointerToCLongs(long... values)
Allocate enough memory for values.length CLong values, copy the values provided as argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<CLong> instance that can be safely iterated upon :
for (float f : pointerTo(1f, 2f, 3.3f))
        System.out.println(f); 

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the CLong consecutive values provided in argument

pointerToCLongs

public static Pointer<CLong> pointerToCLongs(CLong... values)
Allocate enough memory for values.length CLong values, copy the values provided as argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<CLong> instance that can be safely iterated upon :
for (float f : pointerTo(1f, 2f, 3.3f))
        System.out.println(f); 

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the CLong consecutive values provided in argument

pointerToCLongs

public static Pointer<CLong> pointerToCLongs(int[] values)
Allocate enough memory for values.length CLong values, copy the values provided as argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<CLong> instance that can be safely iterated upon :
for (float f : pointerTo(1f, 2f, 3.3f))
        System.out.println(f); 

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the CLong consecutive values provided in argument

allocateCLongs

public static Pointer<CLong> allocateCLongs(long arrayLength)
Allocate enough memory for arrayLength CLong values and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<CLong> instance that can be safely iterated upon.

Returns:
pointer to arrayLength zero-initialized CLong consecutive values

allocateCLong

public static Pointer<CLong> allocateCLong()
Allocate enough memory for a CLong value and return a pointer to it.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().

Returns:
pointer to a single zero-initialized CLong value

getCLong

public long getCLong()
Read a CLong value from the pointed memory location


getCLongAtOffset

public long getCLongAtOffset(long byteOffset)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getCLong() over this method.

Read a CLong value from the pointed memory location shifted by a byte offset


getCLongs

public long[] getCLongs()
Read the array of remaining CLong values from the pointed memory location


getCLongs

public long[] getCLongs(int arrayLength)
Read an array of CLong values of the specified length from the pointed memory location


getCLongsAtOffset

public long[] getCLongsAtOffset(long byteOffset,
                                int arrayLength)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getCLongs(int) over this method.

Read an array of CLong values of the specified length from the pointed memory location shifted by a byte offset


setCLong

public Pointer<T> setCLong(long value)
Write a CLong value to the pointed memory location


setCLong

public Pointer<T> setCLong(CLong value)
Write a CLong value to the pointed memory location


setCLongAtOffset

public Pointer<T> setCLongAtOffset(long byteOffset,
                                   long value)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour setCLong(long) over this method.

Write a CLong value to the pointed memory location shifted by a byte offset


setCLongAtOffset

public Pointer<T> setCLongAtOffset(long byteOffset,
                                   CLong value)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour setCLong(CLong) over this method.

Write a CLong value to the pointed memory location shifted by a byte offset


setCLongs

public Pointer<T> setCLongs(long[] values)
Write an array of CLong values to the pointed memory location


setCLongs

public Pointer<T> setCLongs(int[] values)
Write an array of CLong values to the pointed memory location


setCLongs

public Pointer<T> setCLongs(CLong[] values)
Write an array of CLong values to the pointed memory location


setCLongsAtOffset

public Pointer<T> setCLongsAtOffset(long byteOffset,
                                    long[] values)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour setCLongs(long[]) over this method.

Write an array of CLong values to the pointed memory location shifted by a byte offset


setCLongsAtOffset

public Pointer<T> setCLongsAtOffset(long byteOffset,
                                    long[] values,
                                    int valuesOffset,
                                    int length)

setCLongsAtOffset

public Pointer<T> setCLongsAtOffset(long byteOffset,
                                    CLong... values)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour setCLongs(CLong...) over this method.

Write an array of CLong values to the pointed memory location shifted by a byte offset


setCLongsAtOffset

public Pointer<T> setCLongsAtOffset(long byteOffset,
                                    int[] values)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour setCLongs(int[]) over this method.

Write an array of CLong values to the pointed memory location shifted by a byte offset


pointerToPointer

public static <T> Pointer<Pointer<T>> pointerToPointer(Pointer<T> value)
Allocate enough memory for a single pointer value, copy the value provided in argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).

Parameters:
value - initial value for the created memory location
Returns:
pointer to a new memory location that initially contains the pointer value given in argument

pointerToPointers

public static <T> Pointer<Pointer<T>> pointerToPointers(Pointer<T>... values)
Allocate enough memory for values.length pointer values, copy the values provided as argument into it and return a pointer to that memory.
The memory will be automatically be freed when the pointer is garbage-collected or upon manual calls to release().
The pointer won't be garbage-collected until all its clones / views are garbage-collected themselves (see Object.clone(), offset(long), next(long), next()).
The returned pointer is also an Iterable<Pointer> instance that can be safely iterated upon :
for (float f : pointerTo(1f, 2f, 3.3f))
        System.out.println(f); 

Parameters:
values - initial values for the created memory location
Returns:
pointer to a new memory location that initially contains the pointer consecutive values provided in argument

setValuesAtOffset

public Pointer<T> setValuesAtOffset(long byteOffset,
                                    Buffer values)
Copy all values from an NIO buffer to the pointed memory location shifted by a byte offset


setValuesAtOffset

public Pointer<T> setValuesAtOffset(long byteOffset,
                                    Buffer values,
                                    int valuesOffset,
                                    int length)
Copy length values from an NIO buffer (beginning at element at valuesOffset index) to the pointed memory location shifted by a byte offset


setValues

public Pointer<T> setValues(Buffer values)
Copy values from an NIO buffer to the pointed memory location


copyBytesTo

@Deprecated
public Pointer<T> copyBytesTo(long byteOffset,
                                         Pointer<?> destination,
                                         long byteOffsetInDestination,
                                         long byteCount)
Deprecated. 

Copy bytes from the memory location indicated by this pointer to that of another pointer (with byte offsets for both the source and the destination), using the @see memcpy C function.
If the destination and source memory locations are likely to overlap, moveBytesTo(long, Pointer, long, long) must be used instead.


moveBytesTo

@Deprecated
public Pointer<T> moveBytesTo(long byteOffset,
                                         Pointer<?> destination,
                                         long byteOffsetInDestination,
                                         long byteCount)
Deprecated. 

Copy bytes from the memory location indicated by this pointer to that of another pointer (with byte offsets for both the source and the destination), using the @see memmove C function.
Works even if the destination and source memory locations are overlapping.


copyTo

public void copyTo(Pointer<?> destination)
Copy remaining bytes from this pointer to a destination using the @see memcpy C function (see copyBytesTo(long, Pointer, long, long), getValidBytes())


copyTo

public void copyTo(Pointer<?> destination,
                   long elementCount)
Copy remaining elements from this pointer to a destination using the @see memcpy C function (see copyBytesTo(long, Pointer, long, long), getValidBytes())


setInt

public Pointer<T> setInt(int value)
Write a int value to the pointed memory location


setIntAtOffset

public Pointer<T> setIntAtOffset(long byteOffset,
                                 int value)
Read a int value from the pointed memory location shifted by a byte offset


setInts

public Pointer<T> setInts(int[] values)
Write an array of int values of the specified length to the pointed memory location


setIntsAtOffset

public Pointer<T> setIntsAtOffset(long byteOffset,
                                  int[] values)
Write an array of int values of the specified length to the pointed memory location shifted by a byte offset


setIntsAtOffset

public Pointer<T> setIntsAtOffset(long byteOffset,
                                  int[] values,
                                  int valuesOffset,
                                  int length)
Write an array of int values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given array offset and for the given length from the provided array.


getInt

public int getInt()
Read a int value from the pointed memory location


getIntAtOffset

public int getIntAtOffset(long byteOffset)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getInt() over this method.

Read a int value from the pointed memory location shifted by a byte offset


getInts

public int[] getInts(int length)
Read an array of int values of the specified length from the pointed memory location


getInts

public int[] getInts()
Read the array of remaining int values from the pointed memory location


getIntsAtOffset

public int[] getIntsAtOffset(long byteOffset,
                             int length)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getInts(int) over this method.

Read an array of int values of the specified length from the pointed memory location shifted by a byte offset


setLong

public Pointer<T> setLong(long value)
Write a long value to the pointed memory location


setLongAtOffset

public Pointer<T> setLongAtOffset(long byteOffset,
                                  long value)
Read a long value from the pointed memory location shifted by a byte offset


setLongs

public Pointer<T> setLongs(long[] values)
Write an array of long values of the specified length to the pointed memory location


setLongsAtOffset

public Pointer<T> setLongsAtOffset(long byteOffset,
                                   long[] values)
Write an array of long values of the specified length to the pointed memory location shifted by a byte offset


setLongsAtOffset

public Pointer<T> setLongsAtOffset(long byteOffset,
                                   long[] values,
                                   int valuesOffset,
                                   int length)
Write an array of long values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given array offset and for the given length from the provided array.


getLong

public long getLong()
Read a long value from the pointed memory location


getLongAtOffset

public long getLongAtOffset(long byteOffset)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getLong() over this method.

Read a long value from the pointed memory location shifted by a byte offset


getLongs

public long[] getLongs(int length)
Read an array of long values of the specified length from the pointed memory location


getLongs

public long[] getLongs()
Read the array of remaining long values from the pointed memory location


getLongsAtOffset

public long[] getLongsAtOffset(long byteOffset,
                               int length)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getLongs(int) over this method.

Read an array of long values of the specified length from the pointed memory location shifted by a byte offset


setShort

public Pointer<T> setShort(short value)
Write a short value to the pointed memory location


setShortAtOffset

public Pointer<T> setShortAtOffset(long byteOffset,
                                   short value)
Read a short value from the pointed memory location shifted by a byte offset


setShorts

public Pointer<T> setShorts(short[] values)
Write an array of short values of the specified length to the pointed memory location


setShortsAtOffset

public Pointer<T> setShortsAtOffset(long byteOffset,
                                    short[] values)
Write an array of short values of the specified length to the pointed memory location shifted by a byte offset


setShortsAtOffset

public Pointer<T> setShortsAtOffset(long byteOffset,
                                    short[] values,
                                    int valuesOffset,
                                    int length)
Write an array of short values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given array offset and for the given length from the provided array.


getShort

public short getShort()
Read a short value from the pointed memory location


getShortAtOffset

public short getShortAtOffset(long byteOffset)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getShort() over this method.

Read a short value from the pointed memory location shifted by a byte offset


getShorts

public short[] getShorts(int length)
Read an array of short values of the specified length from the pointed memory location


getShorts

public short[] getShorts()
Read the array of remaining short values from the pointed memory location


getShortsAtOffset

public short[] getShortsAtOffset(long byteOffset,
                                 int length)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getShorts(int) over this method.

Read an array of short values of the specified length from the pointed memory location shifted by a byte offset


setByte

public Pointer<T> setByte(byte value)
Write a byte value to the pointed memory location


setByteAtOffset

public Pointer<T> setByteAtOffset(long byteOffset,
                                  byte value)
Read a byte value from the pointed memory location shifted by a byte offset


setBytes

public Pointer<T> setBytes(byte[] values)
Write an array of byte values of the specified length to the pointed memory location


setBytesAtOffset

public Pointer<T> setBytesAtOffset(long byteOffset,
                                   byte[] values)
Write an array of byte values of the specified length to the pointed memory location shifted by a byte offset


setBytesAtOffset

public Pointer<T> setBytesAtOffset(long byteOffset,
                                   byte[] values,
                                   int valuesOffset,
                                   int length)
Write an array of byte values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given array offset and for the given length from the provided array.


getByte

public byte getByte()
Read a byte value from the pointed memory location


getByteAtOffset

public byte getByteAtOffset(long byteOffset)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getByte() over this method.

Read a byte value from the pointed memory location shifted by a byte offset


getBytes

public byte[] getBytes(int length)
Read an array of byte values of the specified length from the pointed memory location


getBytes

public byte[] getBytes()
Read the array of remaining byte values from the pointed memory location


getBytesAtOffset

public byte[] getBytesAtOffset(long byteOffset,
                               int length)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getBytes(int) over this method.

Read an array of byte values of the specified length from the pointed memory location shifted by a byte offset


setChar

public Pointer<T> setChar(char value)
Write a char value to the pointed memory location


setCharAtOffset

public Pointer<T> setCharAtOffset(long byteOffset,
                                  char value)
Read a char value from the pointed memory location shifted by a byte offset


setChars

public Pointer<T> setChars(char[] values)
Write an array of char values of the specified length to the pointed memory location


setCharsAtOffset

public Pointer<T> setCharsAtOffset(long byteOffset,
                                   char[] values)
Write an array of char values of the specified length to the pointed memory location shifted by a byte offset


setCharsAtOffset

public Pointer<T> setCharsAtOffset(long byteOffset,
                                   char[] values,
                                   int valuesOffset,
                                   int length)
Write an array of char values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given array offset and for the given length from the provided array.


getChar

public char getChar()
Read a char value from the pointed memory location


getCharAtOffset

public char getCharAtOffset(long byteOffset)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getChar() over this method.

Read a char value from the pointed memory location shifted by a byte offset


getChars

public char[] getChars(int length)
Read an array of char values of the specified length from the pointed memory location


getChars

public char[] getChars()
Read the array of remaining char values from the pointed memory location


getCharsAtOffset

public char[] getCharsAtOffset(long byteOffset,
                               int length)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getChars(int) over this method.

Read an array of char values of the specified length from the pointed memory location shifted by a byte offset


setFloat

public Pointer<T> setFloat(float value)
Write a float value to the pointed memory location


setFloatAtOffset

public Pointer<T> setFloatAtOffset(long byteOffset,
                                   float value)
Read a float value from the pointed memory location shifted by a byte offset


setFloats

public Pointer<T> setFloats(float[] values)
Write an array of float values of the specified length to the pointed memory location


setFloatsAtOffset

public Pointer<T> setFloatsAtOffset(long byteOffset,
                                    float[] values)
Write an array of float values of the specified length to the pointed memory location shifted by a byte offset


setFloatsAtOffset

public Pointer<T> setFloatsAtOffset(long byteOffset,
                                    float[] values,
                                    int valuesOffset,
                                    int length)
Write an array of float values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given array offset and for the given length from the provided array.


getFloat

public float getFloat()
Read a float value from the pointed memory location


getFloatAtOffset

public float getFloatAtOffset(long byteOffset)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getFloat() over this method.

Read a float value from the pointed memory location shifted by a byte offset


getFloats

public float[] getFloats(int length)
Read an array of float values of the specified length from the pointed memory location


getFloats

public float[] getFloats()
Read the array of remaining float values from the pointed memory location


getFloatsAtOffset

public float[] getFloatsAtOffset(long byteOffset,
                                 int length)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getFloats(int) over this method.

Read an array of float values of the specified length from the pointed memory location shifted by a byte offset


setDouble

public Pointer<T> setDouble(double value)
Write a double value to the pointed memory location


setDoubleAtOffset

public Pointer<T> setDoubleAtOffset(long byteOffset,
                                    double value)
Read a double value from the pointed memory location shifted by a byte offset


setDoubles

public Pointer<T> setDoubles(double[] values)
Write an array of double values of the specified length to the pointed memory location


setDoublesAtOffset

public Pointer<T> setDoublesAtOffset(long byteOffset,
                                     double[] values)
Write an array of double values of the specified length to the pointed memory location shifted by a byte offset


setDoublesAtOffset

public Pointer<T> setDoublesAtOffset(long byteOffset,
                                     double[] values,
                                     int valuesOffset,
                                     int length)
Write an array of double values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given array offset and for the given length from the provided array.


getDouble

public double getDouble()
Read a double value from the pointed memory location


getDoubleAtOffset

public double getDoubleAtOffset(long byteOffset)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getDouble() over this method.

Read a double value from the pointed memory location shifted by a byte offset


getDoubles

public double[] getDoubles(int length)
Read an array of double values of the specified length from the pointed memory location


getDoubles

public double[] getDoubles()
Read the array of remaining double values from the pointed memory location


getDoublesAtOffset

public double[] getDoublesAtOffset(long byteOffset,
                                   int length)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getDoubles(int) over this method.

Read an array of double values of the specified length from the pointed memory location shifted by a byte offset


setBoolean

public Pointer<T> setBoolean(boolean value)
Write a boolean value to the pointed memory location


setBooleanAtOffset

public Pointer<T> setBooleanAtOffset(long byteOffset,
                                     boolean value)
Read a boolean value from the pointed memory location shifted by a byte offset


setBooleans

public Pointer<T> setBooleans(boolean[] values)
Write an array of boolean values of the specified length to the pointed memory location


setBooleansAtOffset

public Pointer<T> setBooleansAtOffset(long byteOffset,
                                      boolean[] values)
Write an array of boolean values of the specified length to the pointed memory location shifted by a byte offset


setBooleansAtOffset

public Pointer<T> setBooleansAtOffset(long byteOffset,
                                      boolean[] values,
                                      int valuesOffset,
                                      int length)
Write an array of boolean values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given array offset and for the given length from the provided array.


getBoolean

public boolean getBoolean()
Read a boolean value from the pointed memory location


getBooleanAtOffset

public boolean getBooleanAtOffset(long byteOffset)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getBoolean() over this method.

Read a boolean value from the pointed memory location shifted by a byte offset


getBooleans

public boolean[] getBooleans(int length)
Read an array of boolean values of the specified length from the pointed memory location


getBooleans

public boolean[] getBooleans()
Read the array of remaining boolean values from the pointed memory location


getBooleansAtOffset

public boolean[] getBooleansAtOffset(long byteOffset,
                                     int length)
Deprecated. Avoid using the byte offset methods variants unless you know what you're doing (may cause alignment issues). Please favour getBooleans(int) over this method.

Read an array of boolean values of the specified length from the pointed memory location shifted by a byte offset


getInts

public void getInts(int[] dest)
Read int values into the specified destination array from the pointed memory location


getIntsAtOffset

public void getIntsAtOffset(long byteOffset,
                            int[] dest,
                            int destOffset,
                            int length)
Read length int values into the specified destination array from the pointed memory location shifted by a byte offset, storing values after the provided destination offset.


setInts

public Pointer<T> setInts(IntBuffer values)
Write a buffer of int values of the specified length to the pointed memory location


setIntsAtOffset

public Pointer<T> setIntsAtOffset(long byteOffset,
                                  IntBuffer values)
Write a buffer of int values of the specified length to the pointed memory location shifted by a byte offset


setIntsAtOffset

public Pointer<T> setIntsAtOffset(long byteOffset,
                                  IntBuffer values,
                                  long valuesOffset,
                                  long length)
Write a buffer of int values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given buffer offset and for the given length from the provided buffer.


getIntBuffer

public IntBuffer getIntBuffer(long length)
Read a buffer of int values of the specified length from the pointed memory location


getIntBuffer

public IntBuffer getIntBuffer()
Read a buffer of int values of the remaining length from the pointed memory location


getIntBufferAtOffset

public IntBuffer getIntBufferAtOffset(long byteOffset,
                                      long length)
Read a buffer of int values of the specified length from the pointed memory location shifted by a byte offset


getLongs

public void getLongs(long[] dest)
Read long values into the specified destination array from the pointed memory location


getLongsAtOffset

public void getLongsAtOffset(long byteOffset,
                             long[] dest,
                             int destOffset,
                             int length)
Read length long values into the specified destination array from the pointed memory location shifted by a byte offset, storing values after the provided destination offset.


setLongs

public Pointer<T> setLongs(LongBuffer values)
Write a buffer of long values of the specified length to the pointed memory location


setLongsAtOffset

public Pointer<T> setLongsAtOffset(long byteOffset,
                                   LongBuffer values)
Write a buffer of long values of the specified length to the pointed memory location shifted by a byte offset


setLongsAtOffset

public Pointer<T> setLongsAtOffset(long byteOffset,
                                   LongBuffer values,
                                   long valuesOffset,
                                   long length)
Write a buffer of long values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given buffer offset and for the given length from the provided buffer.


getLongBuffer

public LongBuffer getLongBuffer(long length)
Read a buffer of long values of the specified length from the pointed memory location


getLongBuffer

public LongBuffer getLongBuffer()
Read a buffer of long values of the remaining length from the pointed memory location


getLongBufferAtOffset

public LongBuffer getLongBufferAtOffset(long byteOffset,
                                        long length)
Read a buffer of long values of the specified length from the pointed memory location shifted by a byte offset


getShorts

public void getShorts(short[] dest)
Read short values into the specified destination array from the pointed memory location


getShortsAtOffset

public void getShortsAtOffset(long byteOffset,
                              short[] dest,
                              int destOffset,
                              int length)
Read length short values into the specified destination array from the pointed memory location shifted by a byte offset, storing values after the provided destination offset.


setShorts

public Pointer<T> setShorts(ShortBuffer values)
Write a buffer of short values of the specified length to the pointed memory location


setShortsAtOffset

public Pointer<T> setShortsAtOffset(long byteOffset,
                                    ShortBuffer values)
Write a buffer of short values of the specified length to the pointed memory location shifted by a byte offset


setShortsAtOffset

public Pointer<T> setShortsAtOffset(long byteOffset,
                                    ShortBuffer values,
                                    long valuesOffset,
                                    long length)
Write a buffer of short values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given buffer offset and for the given length from the provided buffer.


getShortBuffer

public ShortBuffer getShortBuffer(long length)
Read a buffer of short values of the specified length from the pointed memory location


getShortBuffer

public ShortBuffer getShortBuffer()
Read a buffer of short values of the remaining length from the pointed memory location


getShortBufferAtOffset

public ShortBuffer getShortBufferAtOffset(long byteOffset,
                                          long length)
Read a buffer of short values of the specified length from the pointed memory location shifted by a byte offset


getBytes

public void getBytes(byte[] dest)
Read byte values into the specified destination array from the pointed memory location


getBytesAtOffset

public void getBytesAtOffset(long byteOffset,
                             byte[] dest,
                             int destOffset,
                             int length)
Read length byte values into the specified destination array from the pointed memory location shifted by a byte offset, storing values after the provided destination offset.


setBytes

public Pointer<T> setBytes(ByteBuffer values)
Write a buffer of byte values of the specified length to the pointed memory location


setBytesAtOffset

public Pointer<T> setBytesAtOffset(long byteOffset,
                                   ByteBuffer values)
Write a buffer of byte values of the specified length to the pointed memory location shifted by a byte offset


setBytesAtOffset

public Pointer<T> setBytesAtOffset(long byteOffset,
                                   ByteBuffer values,
                                   long valuesOffset,
                                   long length)
Write a buffer of byte values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given buffer offset and for the given length from the provided buffer.


getByteBuffer

public ByteBuffer getByteBuffer(long length)
Read a buffer of byte values of the specified length from the pointed memory location


getByteBuffer

public ByteBuffer getByteBuffer()
Read a buffer of byte values of the remaining length from the pointed memory location


getByteBufferAtOffset

public ByteBuffer getByteBufferAtOffset(long byteOffset,
                                        long length)
Read a buffer of byte values of the specified length from the pointed memory location shifted by a byte offset


getChars

public void getChars(char[] dest)
Read char values into the specified destination array from the pointed memory location


getCharsAtOffset

public void getCharsAtOffset(long byteOffset,
                             char[] dest,
                             int destOffset,
                             int length)
Read length char values into the specified destination array from the pointed memory location shifted by a byte offset, storing values after the provided destination offset.


setChars

public Pointer<T> setChars(CharBuffer values)
Write a buffer of char values of the specified length to the pointed memory location


setCharsAtOffset

public Pointer<T> setCharsAtOffset(long byteOffset,
                                   CharBuffer values)
Write a buffer of char values of the specified length to the pointed memory location shifted by a byte offset


setCharsAtOffset

public Pointer<T> setCharsAtOffset(long byteOffset,
                                   CharBuffer values,
                                   long valuesOffset,
                                   long length)
Write a buffer of char values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given buffer offset and for the given length from the provided buffer.


getCharBuffer

public CharBuffer getCharBuffer(long length)
Read a buffer of char values of the specified length from the pointed memory location


getCharBuffer

public CharBuffer getCharBuffer()
Read a buffer of char values of the remaining length from the pointed memory location


getCharBufferAtOffset

public CharBuffer getCharBufferAtOffset(long byteOffset,
                                        long length)
Read a buffer of char values of the specified length from the pointed memory location shifted by a byte offset


getFloats

public void getFloats(float[] dest)
Read float values into the specified destination array from the pointed memory location


getFloatsAtOffset

public void getFloatsAtOffset(long byteOffset,
                              float[] dest,
                              int destOffset,
                              int length)
Read length float values into the specified destination array from the pointed memory location shifted by a byte offset, storing values after the provided destination offset.


setFloats

public Pointer<T> setFloats(FloatBuffer values)
Write a buffer of float values of the specified length to the pointed memory location


setFloatsAtOffset

public Pointer<T> setFloatsAtOffset(long byteOffset,
                                    FloatBuffer values)
Write a buffer of float values of the specified length to the pointed memory location shifted by a byte offset


setFloatsAtOffset

public Pointer<T> setFloatsAtOffset(long byteOffset,
                                    FloatBuffer values,
                                    long valuesOffset,
                                    long length)
Write a buffer of float values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given buffer offset and for the given length from the provided buffer.


getFloatBuffer

public FloatBuffer getFloatBuffer(long length)
Read a buffer of float values of the specified length from the pointed memory location


getFloatBuffer

public FloatBuffer getFloatBuffer()
Read a buffer of float values of the remaining length from the pointed memory location


getFloatBufferAtOffset

public FloatBuffer getFloatBufferAtOffset(long byteOffset,
                                          long length)
Read a buffer of float values of the specified length from the pointed memory location shifted by a byte offset


getDoubles

public void getDoubles(double[] dest)
Read double values into the specified destination array from the pointed memory location


getDoublesAtOffset

public void getDoublesAtOffset(long byteOffset,
                               double[] dest,
                               int destOffset,
                               int length)
Read length double values into the specified destination array from the pointed memory location shifted by a byte offset, storing values after the provided destination offset.


setDoubles

public Pointer<T> setDoubles(DoubleBuffer values)
Write a buffer of double values of the specified length to the pointed memory location


setDoublesAtOffset

public Pointer<T> setDoublesAtOffset(long byteOffset,
                                     DoubleBuffer values)
Write a buffer of double values of the specified length to the pointed memory location shifted by a byte offset


setDoublesAtOffset

public Pointer<T> setDoublesAtOffset(long byteOffset,
                                     DoubleBuffer values,
                                     long valuesOffset,
                                     long length)
Write a buffer of double values of the specified length to the pointed memory location shifted by a byte offset, reading values at the given buffer offset and for the given length from the provided buffer.


getDoubleBuffer

public DoubleBuffer getDoubleBuffer(long length)
Read a buffer of double values of the specified length from the pointed memory location


getDoubleBuffer

public DoubleBuffer getDoubleBuffer()
Read a buffer of double values of the remaining length from the pointed memory location


getDoubleBufferAtOffset

public DoubleBuffer getDoubleBufferAtOffset(long byteOffset,
                                            long length)
Read a buffer of double values of the specified length from the pointed memory location shifted by a byte offset


getString

public String getString(Pointer.StringType type)
Read a native string from the pointed memory location using the default charset.
See Pointer#getString(long, StringType, Charset) for more options.

Parameters:
type - Type of the native String to read. See Pointer.StringType for details on the supported types.
Returns:
string read from native memory

getString

public String getString(Pointer.StringType type,
                        Charset charset)
Read a native string from the pointed memory location, using the provided charset or the system's default if not provided. See Pointer#getString(long, StringType, Charset) for more options.

Parameters:
type - Type of the native String to read. See Pointer.StringType for details on the supported types.
charset - Character set used to convert String characters to bytes. If null, Charset.defaultCharset() will be used
Returns:
string read from native memory

getStringAtOffset

public String getStringAtOffset(long byteOffset,
                                Pointer.StringType type,
                                Charset charset)
Read a native string from the pointed memory location shifted by a byte offset, using the provided charset or the system's default if not provided.

Parameters:
byteOffset -
charset - Character set used to convert String characters to bytes. If null, Charset.defaultCharset() will be used
type - Type of the native String to read. See Pointer.StringType for details on the supported types.
Returns:
string read from native memory

setString

public Pointer<T> setString(String s,
                            Pointer.StringType type)
Write a native string to the pointed memory location using the default charset.
See setStringAtOffset(long, String, StringType, Charset) for more options.

Parameters:
s - string to write
type - Type of the native String to write. See Pointer.StringType for details on the supported types.
Returns:
this

setStringAtOffset

public Pointer<T> setStringAtOffset(long byteOffset,
                                    String s,
                                    Pointer.StringType type,
                                    Charset charset)
Write a native string to the pointed memory location shifted by a byte offset, using the provided charset or the system's default if not provided.

Parameters:
byteOffset -
s - string to write
charset - Character set used to convert String characters to bytes. If null, Charset.defaultCharset() will be used
type - Type of the native String to write. See Pointer.StringType for details on the supported types.
Returns:
this

pointerToString

public static Pointer<?> pointerToString(String string,
                                         Pointer.StringType type,
                                         Charset charset)
Allocate memory and write a string to it, using the system's default charset to convert the string (See Pointer.StringType for details on the supported types).
See setString(String, StringType), getString(StringType).

Parameters:
charset - Character set used to convert String characters to bytes. If null, Charset.defaultCharset() will be used
type - Type of the native String to create.

pointerToCString

public static Pointer<Byte> pointerToCString(String string)
Allocate memory and write a C string to it, using the system's default charset to convert the string. (see Pointer.StringType.C).
See setCString(String), getCString().
See pointerToString(String, StringType, Charset) for choice of the String type or Charset.


pointerToCStrings

public static Pointer<Pointer<Byte>> pointerToCStrings(String... strings)
The update will take place inside the release() call


pointerToWideCString

public static Pointer<Character> pointerToWideCString(String string)
Allocate memory and write a WideC string to it, using the system's default charset to convert the string. (see Pointer.StringType.WideC).
See setWideCString(String), getWideCString().
See pointerToString(String, StringType, Charset) for choice of the String type or Charset.


pointerToWideCStrings

public static Pointer<Pointer<Character>> pointerToWideCStrings(String... strings)
The update will take place inside the release() call


getCString

public String getCString()
Read a C string using the default charset from the pointed memory location (see Pointer.StringType.C).
See getCStringAtOffset(long), getString(StringType) and getStringAtOffset(long, StringType, Charset) for more options


getCStringAtOffset

public String getCStringAtOffset(long byteOffset)
Read a C string using the default charset from the pointed memory location shifted by a byte offset (see Pointer.StringType.C).
See getStringAtOffset(long, StringType, Charset) for more options


setCString

public Pointer<T> setCString(String s)
Write a C string using the default charset to the pointed memory location (see Pointer.StringType.C).
See setCStringAtOffset(long, String) and setStringAtOffset(long, String, StringType, Charset) for more options


setCStringAtOffset

public Pointer<T> setCStringAtOffset(long byteOffset,
                                     String s)
Write a C string using the default charset to the pointed memory location shifted by a byte offset (see Pointer.StringType.C).
See setStringAtOffset(long, String, StringType, Charset) for more options


getWideCString

public String getWideCString()
Read a WideC string using the default charset from the pointed memory location (see Pointer.StringType.WideC).
See getWideCStringAtOffset(long), getString(StringType) and getStringAtOffset(long, StringType, Charset) for more options


getWideCStringAtOffset

public String getWideCStringAtOffset(long byteOffset)
Read a WideC string using the default charset from the pointed memory location shifted by a byte offset (see Pointer.StringType.WideC).
See getStringAtOffset(long, StringType, Charset) for more options


setWideCString

public Pointer<T> setWideCString(String s)
Write a WideC string using the default charset to the pointed memory location (see Pointer.StringType.WideC).
See setWideCStringAtOffset(long, String) and setStringAtOffset(long, String, StringType, Charset) for more options


setWideCStringAtOffset

public Pointer<T> setWideCStringAtOffset(long byteOffset,
                                         String s)
Write a WideC string using the default charset to the pointed memory location shifted by a byte offset (see Pointer.StringType.WideC).
See setStringAtOffset(long, String, StringType, Charset) for more options


clearBytes

public void clearBytes(long length)
Write zero bytes to the first length bytes pointed by this pointer


clearBytesAtOffset

public void clearBytesAtOffset(long byteOffset,
                               long length,
                               byte value)
Write a byte value to each of the length bytes at the address pointed to by this pointer shifted by a byteOffset


findByte

public Pointer<T> findByte(long byteOffset,
                           byte value,
                           long searchLength)
Find the first occurrence of a value in the memory block of length searchLength bytes pointed by this pointer shifted by a byteOffset


add

@Deprecated
public boolean add(T item)
Deprecated. 

Implementation of List.add(Object) that throws UnsupportedOperationException

Specified by:
add in interface Collection<T>
Specified by:
add in interface List<T>
Throws:
UnsupportedOperationException

add

@Deprecated
public void add(int index,
                           T element)
Deprecated. 

Implementation of List.add(int, Object) that throws UnsupportedOperationException

Specified by:
add in interface List<T>
Throws:
UnsupportedOperationException

addAll

@Deprecated
public boolean addAll(Collection<? extends T> c)
Deprecated. 

Implementation of List.addAll(Collection) that throws UnsupportedOperationException

Specified by:
addAll in interface Collection<T>
Specified by:
addAll in interface List<T>
Throws:
UnsupportedOperationException

addAll

@Deprecated
public boolean addAll(int index,
                                 Collection<? extends T> c)
Deprecated. 

Implementation of List.addAll(int, Collection) that throws UnsupportedOperationException

Specified by:
addAll in interface List<T>
Throws:
UnsupportedOperationException

clear

@Deprecated
public void clear()
Deprecated. 

Implementation of List.clear() that throws UnsupportedOperationException

Specified by:
clear in interface Collection<T>
Specified by:
clear in interface List<T>
Throws:
UnsupportedOperationException

contains

@Deprecated
public boolean contains(Object o)
Deprecated. 

Implementation of List.contains(Object) that throws UnsupportedOperationException

Specified by:
contains in interface Collection<T>
Specified by:
contains in interface List<T>
Throws:
UnsupportedOperationException

containsAll

@Deprecated
public boolean containsAll(Collection<?> c)
Deprecated. 

Implementation of List.containsAll(Collection) that throws UnsupportedOperationException

Specified by:
containsAll in interface Collection<T>
Specified by:
containsAll in interface List<T>
Throws:
UnsupportedOperationException

get

public final T get(int index)
Implementation of List.get(int)

Specified by:
get in interface List<T>

apply

public final T apply(long index)
Alias for get(long) defined for more natural use from the Scala language.


indexOf

@Deprecated
public int indexOf(Object o)
Deprecated. 

Implementation of List.indexOf(Object) that throws UnsupportedOperationException

Specified by:
indexOf in interface List<T>
Throws:
UnsupportedOperationException

isEmpty

public boolean isEmpty()
Implementation of List.isEmpty()

Specified by:
isEmpty in interface Collection<T>
Specified by:
isEmpty in interface List<T>

lastIndexOf

@Deprecated
public int lastIndexOf(Object o)
Deprecated. 

Implementation of List.lastIndexOf(Object) that throws UnsupportedOperationException

Specified by:
lastIndexOf in interface List<T>
Throws:
UnsupportedOperationException

listIterator

public ListIterator<T> listIterator()
Implementation of List.listIterator()

Specified by:
listIterator in interface List<T>

listIterator

public ListIterator<T> listIterator(int index)
Implementation of List.listIterator(int)

Specified by:
listIterator in interface List<T>

remove

@Deprecated
public T remove(int index)
Deprecated. 

Implementation of List.remove(int) that throws UnsupportedOperationException

Specified by:
remove in interface List<T>
Throws:
UnsupportedOperationException

remove

@Deprecated
public boolean remove(Object o)
Deprecated. 

Implementation of List.remove(Object) that throws UnsupportedOperationException

Specified by:
remove in interface Collection<T>
Specified by:
remove in interface List<T>
Throws:
UnsupportedOperationException

removeAll

@Deprecated
public boolean removeAll(Collection<?> c)
Deprecated. 

Implementation of List.removeAll(Collection) that throws UnsupportedOperationException

Specified by:
removeAll in interface Collection<T>
Specified by:
removeAll in interface List<T>
Throws:
UnsupportedOperationException

retainAll

@Deprecated
public boolean retainAll(Collection<?> c)
Deprecated. 

Implementation of List.retainAll(Collection) that throws UnsupportedOperationException

Specified by:
retainAll in interface Collection<T>
Specified by:
retainAll in interface List<T>
Throws:
UnsupportedOperationException

set

public final T set(int index,
                   T element)
Implementation of List.set(int, Object)

Specified by:
set in interface List<T>

update

public final void update(long index,
                         T element)
Alias for set(long, Object) defined for more natural use from the Scala language.


size

public int size()
Deprecated. Casts the result of getValidElements() to int, so sizes greater that 2^31 will be invalid

Implementation of List.size()

Specified by:
size in interface Collection<T>
Specified by:
size in interface List<T>
Returns:
getValidElements()

subList

public List<T> subList(int fromIndex,
                       int toIndex)
Implementation of List.subList(int, int)

Specified by:
subList in interface List<T>

toArray

public T[] toArray()
Implementation of List.toArray()

Specified by:
toArray in interface Collection<T>
Specified by:
toArray in interface List<T>

toArray

public <U> U[] toArray(U[] array)
Implementation of List.toArray(Object[])

Specified by:
toArray in interface Collection<T>
Specified by:
toArray in interface List<T>


Copyright © 2009-2011. All Rights Reserved.