@Properties(inherit=javacpp.class) public class LongPointer extends Pointer
long long.
All operations take into account the position and limit, when appropriate.Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.DeallocatorReference, Pointer.DeallocatorThread, Pointer.NativeDeallocator, Pointer.ProxyDeallocator, Pointer.ReferenceCounter| Modifier and Type | Field and Description |
|---|---|
private static Logger |
logger |
address, capacity, deallocatorThread, limit, maxBytes, maxPhysicalBytes, maxRetries, position| Constructor and Description |
|---|
LongPointer() |
LongPointer(long... array)
Allocates enough memory for the array and copies it.
|
LongPointer(long size)
Allocates a native
long long array of the given size. |
LongPointer(LongBuffer buffer)
For direct buffers, calls
Pointer(Buffer), while for buffers
backed with an array, allocates enough memory for the array and copies it. |
LongPointer(Pointer p) |
| Modifier and Type | Method and Description |
|---|---|
private void |
allocateArray(long size) |
LongBuffer |
asBuffer()
Same as
Pointer.asByteBuffer(), but can be overridden to return subclasses of Buffer. |
LongPointer |
capacity(long capacity)
Sets the capacity and returns this.
|
long |
get() |
long |
get(long i) |
LongPointer |
get(long[] array) |
LongPointer |
get(long[] array,
int offset,
int length)
Reads a portion of the native array into a Java array.
|
LongPointer |
getPointer(long i)
Returns
getPointer(getClass(), i). |
LongPointer |
limit(long limit)
Sets the limit and returns this.
|
LongPointer |
position(long position)
Sets the position and returns this.
|
LongPointer |
put(long... array) |
LongPointer |
put(long l) |
LongPointer |
put(long[] array,
int offset,
int length)
Writes a portion of a Java array into the native array.
|
LongPointer |
put(long i,
long l)
Copies the
long long value to the i-th element of a native array. |
int |
sizeof()
Returns 1 for Pointer or BytePointer else
Loader.sizeof(getClass()) or -1 on error. |
address, asByteBuffer, availablePhysicalBytes, calloc, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, hashCode, init, interruptDeallocatorThread, isNull, isNull, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zeroprivate static final Logger logger
public LongPointer(long... array)
array - the array to copyput(long[])public LongPointer(LongBuffer buffer)
Pointer(Buffer), while for buffers
backed with an array, allocates enough memory for the array and copies it.buffer - the Buffer to reference or copyput(long[])public LongPointer(long size)
long long array of the given size.size - the number of long long elements to allocatepublic LongPointer()
Pointer()public LongPointer(Pointer p)
Pointer(Pointer)private void allocateArray(long size)
public LongPointer position(long position)
Pointerarray.position(i)
statement sort of equivalent to the array[i] statement in C++.position in class Pointerposition - the new positionPointer.position(long)public LongPointer limit(long limit)
Pointerlimit in class Pointerlimit - the new limitPointer.limit(long)public LongPointer capacity(long capacity)
Pointercapacity in class Pointercapacity - the new capacityPointer.capacity(long)public int sizeof()
PointerLoader.sizeof(getClass()) or -1 on error.public LongPointer getPointer(long i)
PointergetPointer(getClass(), i).getPointer in class Pointerpublic long get()
get(0)public long get(long i)
long long of a native arraypublic LongPointer put(long l)
put(0, l)public LongPointer put(long i, long l)
long long value to the i-th element of a native array.i - the index into the arrayl - the long long value to copypublic LongPointer get(long[] array)
get(array, 0, array.length)public LongPointer put(long... array)
put(array, 0, array.length)public LongPointer get(long[] array, int offset, int length)
array - the array to write tooffset - the offset into the array where to start writinglength - the length of data to read and writepublic LongPointer put(long[] array, int offset, int length)
array - the array to read fromoffset - the offset into the array where to start readinglength - the length of data to read and writepublic final LongBuffer asBuffer()
PointerPointer.asByteBuffer(), but can be overridden to return subclasses of Buffer.asBuffer in class PointerasByteBuffer().asLongBuffer()BytePointer.asBuffer(),
ShortPointer.asBuffer(),
IntPointer.asBuffer(),
asBuffer(),
FloatPointer.asBuffer(),
DoublePointer.asBuffer(),
CharPointer.asBuffer()Copyright © 2025. All rights reserved.