Package com.jogamp.common.nio
Class PointerBuffer
- All Implemented Interfaces:
NativeBuffer<PointerBuffer>
Hardware independent container for native pointer arrays.
The native values (NIO direct ByteBuffer) might be 32bit or 64bit wide,
depending of the CPU pointer width.
- Author:
- Sven Gothel, Michael Bien
-
Field Summary
FieldsFields inherited from class com.jogamp.common.nio.AbstractBuffer
buffer, capacity, elementSize, position -
Method Summary
Modifier and TypeMethodDescriptionstatic PointerBufferallocate(int size) Returns a non direct PointerBuffer in native order, having a backup arraystatic PointerBufferallocateDirect(int size) Returns a direct PointerBuffer in native order, w/o backup arrayfinal PointerBufferfinal longget()Relative get method.final longget(int idx) Absolute get method.final PointerBufferget(long[] dest, int offset, int length) Relative bulk get method.final Bufferfinal BuffergetReferencedBuffer(int index) final PointerBufferput(int idx, long v) Absolute put method.final PointerBufferput(long value) Relative put method.final PointerBufferput(long[] src, int offset, int length) Relative bulk put method.final PointerBufferput(PointerBuffer src) Relative bulk get method.final PointerBufferreferenceBuffer(int index, Buffer bb) Put the address of the given direct Buffer at the given position of this pointer array.final PointerBufferPut the address of the given direct Buffer at the end of this pointer array.toString()static PointerBufferwrap(ByteBuffer src) Methods inherited from class com.jogamp.common.nio.AbstractBuffer
array, arrayOffset, capacity, elementSize, getBuffer, hasArray, hasRemaining, isDirect, limit, position, position, remaining, rewind
-
Field Details
-
ELEMENT_SIZE
public static final int ELEMENT_SIZE -
dataMap
-
-
Method Details
-
allocate
Returns a non direct PointerBuffer in native order, having a backup array -
allocateDirect
Returns a direct PointerBuffer in native order, w/o backup array -
wrap
-
duplicate
- Returns:
- new PointerBuffer sharing the same buffer data of this instance (identity), but having an independent position.
-
put
Relative bulk get method. Copy the source valuessrc[position .. capacity] [to this buffer and increment the position bycapacity-position. -
get
public final long get()Relative get method. Get the pointer value at the current position and increment the position by one. -
get
public final long get(int idx) Absolute get method. Get the pointer value at the given index -
get
Relative bulk get method. Copy the pointer values[ position .. position+length [to the destination array[ dest[offset] .. dest[offset+length] [and increment the position bylength. -
put
Absolute put method. Put the pointer value at the given index -
put
Relative put method. Put the pointer value at the current position and increment the position by one. -
put
Relative bulk put method. Put the pointer values[ src[offset] .. src[offset+length] [at the current position and increment the position bylength. -
referenceBuffer
Put the address of the given direct Buffer at the given position of this pointer array. Adding a reference of the given direct Buffer to this object.- Throws:
IllegalArgumentException- if bb is null or not a direct buffer
-
referenceBuffer
Put the address of the given direct Buffer at the end of this pointer array. Adding a reference of the given direct Buffer to this object. -
getReferencedBuffer
-
getReferencedBuffer
-
toString
- Overrides:
toStringin classAbstractBuffer<PointerBuffer>
-