@Name(value="long") public class CLongPointer extends Pointer
long
.
All operations take into account the position and limit, when appropriate.
We need this class because platforms supported by Java do not all agree on the
size of the native C++ long
type, unlike int
and short
.
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.DeallocatorReference, Pointer.DeallocatorThread, Pointer.NativeDeallocator
address, capacity, deallocatorThread, limit, maxBytes, maxPhysicalBytes, maxRetries, position
Constructor and Description |
---|
CLongPointer() |
CLongPointer(long size)
Allocates a native
long array of the given size. |
CLongPointer(Pointer p) |
Modifier and Type | Method and Description |
---|---|
private void |
allocateArray(long size) |
CLongPointer |
capacity(long capacity)
Sets the capacity and returns this.
|
long |
get() |
long |
get(long i) |
CLongPointer |
limit(long limit)
Sets the limit and returns this.
|
CLongPointer |
position(long position)
Sets the position and returns this.
|
CLongPointer |
put(long l) |
CLongPointer |
put(long i,
long l)
Copies the
long value to the i-th element of a native array. |
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, hashCode, init, isNull, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, put, realloc, setNull, sizeof, toString, totalBytes, totalPhysicalBytes, withDeallocator, zero
public CLongPointer(long size)
long
array of the given size.size
- the number of long
elements to allocatepublic CLongPointer()
Pointer.Pointer()
public CLongPointer(Pointer p)
Pointer.Pointer(Pointer)
private void allocateArray(long size)
public CLongPointer position(long position)
Pointer
array.position(i)
statement sort of equivalent to the array[i]
statement in C++.position
in class Pointer
position
- the new positionPointer.position(long)
public CLongPointer limit(long limit)
Pointer
limit
in class Pointer
limit
- the new limitPointer.limit(long)
public CLongPointer capacity(long capacity)
Pointer
capacity
in class Pointer
capacity
- the new capacityPointer.capacity(long)
public long get()
get(0)
public CLongPointer put(long l)
put(0, l)
public CLongPointer put(long i, long l)
long
value to the i-th element of a native array.i
- the index into the arrayl
- the long
value to copyCopyright © 2018. All rights reserved.