Package com.jogamp.common.nio
Interface NativeBuffer<B extends NativeBuffer>
-
- All Known Implementing Classes:
AbstractBuffer
,PointerBuffer
public interface NativeBuffer<B extends NativeBuffer>
Hardware independent container for various kinds of buffers.- Author:
- Sven Gothel, Michael Bien
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Object
array()
int
arrayOffset()
int
capacity()
int
elementSize()
long
get()
long
get(int idx)
Buffer
getBuffer()
boolean
hasArray()
boolean
hasRemaining()
boolean
isDirect()
int
limit()
int
position()
B
position(int newPos)
B
put(int index, long value)
B
put(long value)
B
put(B src)
int
remaining()
B
rewind()
-
-
-
Method Detail
-
elementSize
int elementSize()
-
limit
int limit()
-
capacity
int capacity()
-
position
int position()
-
position
B position(int newPos)
-
remaining
int remaining()
-
hasRemaining
boolean hasRemaining()
-
hasArray
boolean hasArray()
- Returns:
- true if this buffer has a primitive backup array, otherwise false
-
arrayOffset
int arrayOffset()
- Returns:
- the array offset of the optional primitive backup array of the buffer if
hasArray()
is true, otherwise 0.
-
array
Object array() throws UnsupportedOperationException
- Returns:
- the primitive backup array of the buffer if
hasArray()
is true, otherwise it throwsUnsupportedOperationException
. The returned primitive array maybe of typeint[]
orlong[]
, etc .. - Throws:
UnsupportedOperationException
- if this object has no backup array- See Also:
hasArray()
-
getBuffer
Buffer getBuffer()
-
isDirect
boolean isDirect()
-
rewind
B rewind()
-
put
B put(int index, long value)
-
put
B put(long value)
-
get
long get()
-
get
long get(int idx)
-
-