public class SizeTPointer extends Pointer
size_t.
All operations take into account the position and limit, when appropriate.
We need this class because the size differs between 32-bit and 64-bit platforms.
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator| Constructor and Description |
|---|
SizeTPointer() |
SizeTPointer(int size)
Allocates a native
size_t array of the given size. |
SizeTPointer(Pointer p) |
| Modifier and Type | Method and Description |
|---|---|
private void |
allocateArray(int size) |
SizeTPointer |
capacity(int capacity)
Sets the capacity and returns this.
|
long |
get() |
long |
get(int i) |
SizeTPointer |
limit(int limit)
Sets the limit and returns this.
|
SizeTPointer |
position(int position)
Sets the position and returns this.
|
SizeTPointer |
put(int i,
long s)
Copies the
size_t value to the i-th element of a native array. |
SizeTPointer |
put(long s) |
address, asBuffer, asByteBuffer, capacity, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, hashCode, init, isNull, limit, memchr, memcmp, memcpy, memmove, memset, offsetof, position, put, setNull, sizeof, toString, withDeallocator, zeropublic SizeTPointer(int size)
size_t array of the given size.size - the number of size_t elements to allocatepublic SizeTPointer()
Pointer.Pointer()public SizeTPointer(Pointer p)
Pointer.Pointer(Pointer)private void allocateArray(int size)
public SizeTPointer position(int position)
Pointerarray.position(i)
statement sort of equivalent to the array[i] statement in C++.position in class Pointerposition - the new positionPointer.position(int)public SizeTPointer limit(int limit)
Pointerlimit in class Pointerlimit - the new limitPointer.limit(int)public SizeTPointer capacity(int capacity)
Pointercapacity in class Pointercapacity - the new capacityPointer.capacity(int)public long get()
get(0)public long get(int i)
size_t value of a native arraypublic SizeTPointer put(long s)
put(0, s)public SizeTPointer put(int i, long s)
size_t value to the i-th element of a native array.i - the index into the arrays - the size_t value to copyCopyright © 2014. All Rights Reserved.