public interface Buffer extends Positional
defaultMemReqSvr
Modifier and Type | Method and Description |
---|---|
default Memory |
asMemory()
Convert this Buffer to a Memory.
|
Memory |
asMemory(ByteOrder byteOrder)
Convert this Buffer to a Memory with the given byte order.
|
int |
compareTo(long thisOffsetBytes,
long thisLengthBytes,
Buffer that,
long thatOffsetBytes,
long thatLengthBytes)
Compares the bytes of this Buffer to that Buffer.
|
default Buffer |
duplicate()
Returns a read-only duplicate view of this Buffer with the same byte order,
but independent values of
start, position and end.
|
Buffer |
duplicate(ByteOrder byteOrder)
Returns a read-only duplicate view of this Buffer with the same but independent values of
start, position and end, but with the specified byteOrder.
|
boolean |
getBoolean()
Gets the boolean value at the current position.
|
boolean |
getBoolean(long offsetBytes)
Gets the boolean value at the given offset.
|
byte |
getByte()
Gets the byte value at the current position.
|
byte |
getByte(long offsetBytes)
Gets the byte value at the given offset.
|
void |
getByteArray(byte[] dstArray,
int dstOffsetBytes,
int lengthBytes)
Gets the byte array at the current position.
|
char |
getChar()
Gets the char value at the current position.
|
char |
getChar(long offsetBytes)
Gets the char value at the given offset.
|
void |
getCharArray(char[] dstArray,
int dstOffsetChars,
int lengthChars)
Gets the char array at the current position.
|
double |
getDouble()
Gets the double value at the current position.
|
double |
getDouble(long offsetBytes)
Gets the double value at the given offset.
|
void |
getDoubleArray(double[] dstArray,
int dstOffsetDoubles,
int lengthDoubles)
Gets the double array at the current position.
|
float |
getFloat()
Gets the float value at the current position.
|
float |
getFloat(long offsetBytes)
Gets the float value at the given offset.
|
void |
getFloatArray(float[] dstArray,
int dstOffsetFloats,
int lengthFloats)
Gets the float array at the current position.
|
int |
getInt()
Gets the int value at the current position.
|
int |
getInt(long offsetBytes)
Gets the int value at the given offset.
|
void |
getIntArray(int[] dstArray,
int dstOffsetInts,
int lengthInts)
Gets the int array at the current position.
|
long |
getLong()
Gets the long value at the current position.
|
long |
getLong(long offsetBytes)
Gets the long value at the given offset.
|
void |
getLongArray(long[] dstArray,
int dstOffsetLongs,
int lengthLongs)
Gets the long array at the current position.
|
short |
getShort()
Gets the short value at the current position.
|
short |
getShort(long offsetBytes)
Gets the short value at the given offset.
|
void |
getShortArray(short[] dstArray,
int dstOffsetShorts,
int lengthShorts)
Gets the short array at the current position.
|
default Buffer |
region()
A region is a read-only view of this object from position to end
and with the same byte order.
|
Buffer |
region(long offsetBytes,
long capacityBytes,
ByteOrder byteOrder)
A region is a read-only view of this object from offsetBytes and with a length of
capacityBytes and with the given byte order.
|
static Buffer |
wrap(ByteBuffer byteBuffer)
Provides a view of the given ByteBuffer for read-only operations.
|
static Buffer |
wrap(ByteBuffer byteBuffer,
ByteOrder byteOrder)
Provides a view of the given ByteBuffer for read-only operations.
|
getEnd, getPosition, getRemaining, getStart, hasRemaining, incrementPosition, resetPosition, setPosition, setStartPositionEnd
close, equalTo, equalTo, force, getCapacity, getCumulativeOffset, getCumulativeOffset, getMemoryRequestServer, getRelativeOffset, getTypeByteOrder, hasByteBuffer, hasMemoryRequestServer, isAlive, isByteOrderCompatible, isCloseable, isDirect, isDuplicate, isHeap, isLoaded, isMapped, isMemory, isNonNativeOrder, isReadOnly, isRegionView, isSameResource, load, setMemoryRequestServer, toString, toString, xxHash64, xxHash64
static Buffer wrap(ByteBuffer byteBuffer)
byteBuffer
- the given ByteBuffer, must not be null.static Buffer wrap(ByteBuffer byteBuffer, ByteOrder byteOrder)
byteBuffer
- the given ByteBuffer. It must be non-nullbyteOrder
- the ByteOrder to be used. It must be non-null.default Buffer duplicate()
Buffer duplicate(ByteOrder byteOrder)
byteOrder
- the given ByteOrder.default Buffer region()
Buffer region(long offsetBytes, long capacityBytes, ByteOrder byteOrder)
offsetBytes
- the starting offset with respect to the origin of this WritableBuffercapacityBytes
- the capacity of the returned region in bytesbyteOrder
- the given byte orderdefault Memory asMemory()
Memory asMemory(ByteOrder byteOrder)
byteOrder
- the given byte order.boolean getBoolean()
boolean getBoolean(long offsetBytes)
offsetBytes
- offset bytes relative to this Memory startbyte getByte()
byte getByte(long offsetBytes)
offsetBytes
- offset bytes relative to this Memory startvoid getByteArray(byte[] dstArray, int dstOffsetBytes, int lengthBytes)
dstArray
- The preallocated destination array.dstOffsetBytes
- offset in array unitslengthBytes
- number of array units to transferchar getChar()
char getChar(long offsetBytes)
offsetBytes
- offset bytes relative to this Memory startvoid getCharArray(char[] dstArray, int dstOffsetChars, int lengthChars)
dstArray
- The preallocated destination array.dstOffsetChars
- offset in array unitslengthChars
- number of array units to transferdouble getDouble()
double getDouble(long offsetBytes)
offsetBytes
- offset bytes relative to this Memory startvoid getDoubleArray(double[] dstArray, int dstOffsetDoubles, int lengthDoubles)
dstArray
- The preallocated destination array.dstOffsetDoubles
- offset in array unitslengthDoubles
- number of array units to transferfloat getFloat()
float getFloat(long offsetBytes)
offsetBytes
- offset bytes relative to this Memory startvoid getFloatArray(float[] dstArray, int dstOffsetFloats, int lengthFloats)
dstArray
- The preallocated destination array.dstOffsetFloats
- offset in array unitslengthFloats
- number of array units to transferint getInt()
int getInt(long offsetBytes)
offsetBytes
- offset bytes relative to this Memory startvoid getIntArray(int[] dstArray, int dstOffsetInts, int lengthInts)
dstArray
- The preallocated destination array.dstOffsetInts
- offset in array unitslengthInts
- number of array units to transferlong getLong()
long getLong(long offsetBytes)
offsetBytes
- offset bytes relative to this Memory startvoid getLongArray(long[] dstArray, int dstOffsetLongs, int lengthLongs)
dstArray
- The preallocated destination array.dstOffsetLongs
- offset in array unitslengthLongs
- number of array units to transfershort getShort()
short getShort(long offsetBytes)
offsetBytes
- offset bytes relative to this Memory startvoid getShortArray(short[] dstArray, int dstOffsetShorts, int lengthShorts)
dstArray
- The preallocated destination array.dstOffsetShorts
- offset in array unitslengthShorts
- number of array units to transferint compareTo(long thisOffsetBytes, long thisLengthBytes, Buffer that, long thatOffsetBytes, long thatLengthBytes)
thisOffsetBytes
- the starting offset for this BufferthisLengthBytes
- the length of the region to compare from this Bufferthat
- the other Buffer to compare withthatOffsetBytes
- the starting offset for that BufferthatLengthBytes
- the length of the region to compare from that BufferCopyright © 2015–2024. All rights reserved.