public interface WritableBuffer extends Buffer
defaultMemReqSvr
Modifier and Type | Method and Description |
---|---|
default WritableMemory |
asWritableMemory()
Convert this WritableBuffer to a WritableMemory.
|
WritableMemory |
asWritableMemory(ByteOrder byteOrder)
Convert this WritableBuffer to a WritableMemory with the given byte order.
|
void |
clear()
Clears all bytes of this Buffer from position to end to zero.
|
void |
fill(byte value)
Fills this Buffer from position to end with the given byte value.
|
Object |
getArray()
Returns the primitive backing array, otherwise null.
|
void |
putBoolean(boolean value)
Puts the boolean value at the current position.
|
void |
putBoolean(long offsetBytes,
boolean value)
Puts the boolean value at the given offset.
|
void |
putByte(byte value)
Puts the byte value at the current position.
|
void |
putByte(long offsetBytes,
byte value)
Puts the byte value at the given offset.
|
void |
putByteArray(byte[] srcArray,
int srcOffsetBytes,
int lengthBytes)
Puts the byte array at the current position.
|
void |
putChar(char value)
Puts the char value at the current position.
|
void |
putChar(long offsetBytes,
char value)
Puts the char value at the given offset.
|
void |
putCharArray(char[] srcArray,
int srcOffsetChars,
int lengthChars)
Puts the char array at the current position.
|
void |
putDouble(double value)
Puts the double value at the current position.
|
void |
putDouble(long offsetBytes,
double value)
Puts the double value at the given offset.
|
void |
putDoubleArray(double[] srcArray,
int srcOffsetDoubles,
int lengthDoubles)
Puts the double array at the current position.
|
void |
putFloat(float value)
Puts the float value at the current position.
|
void |
putFloat(long offsetBytes,
float value)
Puts the float value at the given offset.
|
void |
putFloatArray(float[] srcArray,
int srcOffsetFloats,
int lengthFloats)
Puts the float array at the current position.
|
void |
putInt(int value)
Puts the int value at the current position.
|
void |
putInt(long offsetBytes,
int value)
Puts the int value at the given offset.
|
void |
putIntArray(int[] srcArray,
int srcOffsetInts,
int lengthInts)
Puts the int array at the current position.
|
void |
putLong(long value)
Puts the long value at the current position.
|
void |
putLong(long offsetBytes,
long value)
Puts the long value at the given offset.
|
void |
putLongArray(long[] srcArray,
int srcOffsetLongs,
int lengthLongs)
Puts the long array at the current position.
|
void |
putShort(long offsetBytes,
short value)
Puts the short value at the given offset.
|
void |
putShort(short value)
Puts the short value at the current position.
|
void |
putShortArray(short[] srcArray,
int srcOffsetShorts,
int lengthShorts)
Puts the short array at the current position.
|
WritableBuffer |
writableDuplicate()
Returns a duplicate writable view of this Buffer with the same but independent values of
start, position and end.
|
WritableBuffer |
writableDuplicate(ByteOrder byteOrder)
Returns a duplicate writable view of this Buffer with the same but independent values of
start, position and end, but with the specified byteOrder.
|
WritableBuffer |
writableRegion()
A writable region is a writable view of this object.
|
WritableBuffer |
writableRegion(long offsetBytes,
long capacityBytes,
ByteOrder byteOrder)
A writable region is a writable view of this object.
|
static WritableBuffer |
writableWrap(ByteBuffer byteBuffer)
Provides a view of the given ByteBuffer for write operations.
|
static WritableBuffer |
writableWrap(ByteBuffer byteBuffer,
ByteOrder byteOrder,
MemoryRequestServer memReqSvr)
Provides a view of the given ByteBuffer for write operations.
|
asMemory, asMemory, compareTo, duplicate, duplicate, getBoolean, getBoolean, getByte, getByte, getByteArray, getChar, getChar, getCharArray, getDouble, getDouble, getDoubleArray, getFloat, getFloat, getFloatArray, getInt, getInt, getIntArray, getLong, getLong, getLongArray, getShort, getShort, getShortArray, region, region, wrap, wrap
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 WritableBuffer writableWrap(ByteBuffer byteBuffer)
byteBuffer
- the given ByteBuffer. It must be non-null and writable.static WritableBuffer writableWrap(ByteBuffer byteBuffer, ByteOrder byteOrder, MemoryRequestServer memReqSvr)
byteBuffer
- the given ByteBuffer. It must be non-null and writable.byteOrder
- the byte order to be used. It must be non-null.memReqSvr
- A user-specified MemoryRequestServer, which may be null.
This is a callback mechanism for a user client to request more memory.IllegalArgumentException
- if ByteBuffer is not writableWritableBuffer writableDuplicate()
WritableBuffer writableDuplicate(ByteOrder byteOrder)
byteOrder
- the given ByteOrder. It must be non-null.WritableBuffer writableRegion()
WritableBuffer writableRegion(long offsetBytes, long capacityBytes, ByteOrder byteOrder)
Note: asWritableMemory() and asMemory() will return the originating Memory byte order.
offsetBytes
- the starting offset with respect to the origin of this WritableBuffercapacityBytes
- the capacity of the returned region in bytesbyteOrder
- the given byte order. It must be non-null.default WritableMemory asWritableMemory()
WritableMemory asWritableMemory(ByteOrder byteOrder)
byteOrder
- the byte order to be used. It must be non-null.void putBoolean(boolean value)
value
- the value to putvoid putBoolean(long offsetBytes, boolean value)
offsetBytes
- offset bytes relative to this WritableMemory start.value
- the value to putvoid putByte(byte value)
value
- the value to putvoid putByte(long offsetBytes, byte value)
offsetBytes
- offset bytes relative to this WritableMemory startvalue
- the value to putvoid putByteArray(byte[] srcArray, int srcOffsetBytes, int lengthBytes)
srcArray
- The source array.srcOffsetBytes
- offset in array unitslengthBytes
- number of array units to transfervoid putChar(char value)
value
- the value to putvoid putChar(long offsetBytes, char value)
offsetBytes
- offset bytes relative to this WritableMemory startvalue
- the value to putvoid putCharArray(char[] srcArray, int srcOffsetChars, int lengthChars)
srcArray
- The source array.srcOffsetChars
- offset in array unitslengthChars
- number of array units to transfervoid putDouble(double value)
value
- the value to putvoid putDouble(long offsetBytes, double value)
offsetBytes
- offset bytes relative to this WritableMemory startvalue
- the value to putvoid putDoubleArray(double[] srcArray, int srcOffsetDoubles, int lengthDoubles)
srcArray
- The source array.srcOffsetDoubles
- offset in array unitslengthDoubles
- number of array units to transfervoid putFloat(float value)
value
- the value to putvoid putFloat(long offsetBytes, float value)
offsetBytes
- offset bytes relative to this WritableMemory startvalue
- the value to putvoid putFloatArray(float[] srcArray, int srcOffsetFloats, int lengthFloats)
srcArray
- The source array.srcOffsetFloats
- offset in array unitslengthFloats
- number of array units to transfervoid putInt(int value)
value
- the value to putvoid putInt(long offsetBytes, int value)
offsetBytes
- offset bytes relative to this WritableMemory startvalue
- the value to putvoid putIntArray(int[] srcArray, int srcOffsetInts, int lengthInts)
srcArray
- The source array.srcOffsetInts
- offset in array unitslengthInts
- number of array units to transfervoid putLong(long value)
value
- the value to putvoid putLong(long offsetBytes, long value)
offsetBytes
- offset bytes relative to this WritableMemory startvalue
- the value to putvoid putLongArray(long[] srcArray, int srcOffsetLongs, int lengthLongs)
srcArray
- The source array.srcOffsetLongs
- offset in array unitslengthLongs
- number of array units to transfervoid putShort(short value)
value
- the value to putvoid putShort(long offsetBytes, short value)
offsetBytes
- offset bytes relative to this WritableMemory startvalue
- the value to putvoid putShortArray(short[] srcArray, int srcOffsetShorts, int lengthShorts)
srcArray
- The source array.srcOffsetShorts
- offset in array unitslengthShorts
- number of array units to transferObject getArray()
void clear()
void fill(byte value)
value
- the given byte valueCopyright © 2015–2024. All rights reserved.