public interface MutableDirectBuffer extends DirectBuffer
ByteOrder
of a wrapped buffer is not applied to the MutableDirectBuffer
.
To control ByteOrder
use the appropriate method with a ByteOrder
overload.
DISABLE_ARRAY_CONTENT_PRINTOUT_PROP_NAME, STR_HEADER_LEN
Modifier and Type | Method and Description |
---|---|
boolean |
isExpandable()
Is this buffer expandable to accommodate putting data into it beyond the current capacity?
|
void |
putByte(int index,
byte value)
Put a value to a given index.
|
void |
putBytes(int index,
byte[] src)
Put an array of src into the underlying buffer.
|
void |
putBytes(int index,
byte[] src,
int offset,
int length)
Put an array into the underlying buffer.
|
void |
putBytes(int index,
ByteBuffer srcBuffer,
int length)
Put bytes into the underlying buffer for the view.
|
void |
putBytes(int index,
ByteBuffer srcBuffer,
int srcIndex,
int length)
Put bytes into the underlying buffer for the view.
|
void |
putBytes(int index,
DirectBuffer srcBuffer,
int srcIndex,
int length)
Put bytes from a source
DirectBuffer into this MutableDirectBuffer at given indices. |
void |
putChar(int index,
char value)
Put a value to a given index.
|
void |
putChar(int index,
char value,
ByteOrder byteOrder)
Put a value to a given index.
|
void |
putDouble(int index,
double value)
Put a value to a given index.
|
void |
putDouble(int index,
double value,
ByteOrder byteOrder)
Put a value to a given index.
|
void |
putFloat(int index,
float value)
Put a value to a given index.
|
void |
putFloat(int index,
float value,
ByteOrder byteOrder)
Put a value to a given index.
|
void |
putInt(int index,
int value)
Put a value to a given index.
|
void |
putInt(int index,
int value,
ByteOrder byteOrder)
Put a value to a given index.
|
int |
putIntAscii(int index,
int value)
Puts an ASCII encoded int into the buffer.
|
void |
putLong(int index,
long value)
Put a value to a given index.
|
void |
putLong(int index,
long value,
ByteOrder byteOrder)
Put a value to a given index.
|
int |
putLongAscii(int index,
long value)
Puts an ASCII encoded long integer into the buffer.
|
int |
putNaturalIntAscii(int index,
int value)
Puts an ASCII encoded int sized natural number into the buffer.
|
int |
putNaturalIntAsciiFromEnd(int value,
int endExclusive)
Encode a natural number starting at its end position.
|
int |
putNaturalLongAscii(int index,
long value)
Puts an ASCII encoded long sized natural number into the buffer.
|
void |
putNaturalPaddedIntAscii(int index,
int length,
int value)
Encode a natural number with a specified maximum length.
|
void |
putShort(int index,
short value)
Put a value to a given index.
|
void |
putShort(int index,
short value,
ByteOrder byteOrder)
Put a value to a given index.
|
int |
putStringAscii(int index,
String value)
Encode a String as ASCII bytes to the buffer with a length prefix.
|
int |
putStringAscii(int index,
String value,
ByteOrder byteOrder)
Encode a String as ASCII bytes to the buffer with a length prefix.
|
int |
putStringUtf8(int index,
String value)
Encode a String as UTF-8 bytes to the buffer with a length prefix.
|
int |
putStringUtf8(int index,
String value,
ByteOrder byteOrder)
Encode a String as UTF-8 bytes to the buffer with a length prefix.
|
int |
putStringUtf8(int index,
String value,
ByteOrder byteOrder,
int maxEncodedLength)
Encode a String as UTF-8 bytes the buffer with a length prefix with a maximum encoded size check.
|
int |
putStringUtf8(int index,
String value,
int maxEncodedLength)
Encode a String as UTF-8 bytes the buffer with a length prefix with a maximum encoded size check.
|
int |
putStringWithoutLengthAscii(int index,
String value)
Encode a String as ASCII bytes in the buffer without a length prefix.
|
int |
putStringWithoutLengthAscii(int index,
String value,
int valueOffset,
int length)
Encode a String as ASCII bytes in the buffer without a length prefix taking a range of the value.
|
int |
putStringWithoutLengthUtf8(int index,
String value)
Encode a String as UTF-8 bytes in the buffer without a length prefix.
|
void |
setMemory(int index,
int length,
byte value)
Set a region of memory to a given byte value.
|
addressOffset, boundsCheck, byteArray, byteBuffer, capacity, checkLimit, getByte, getBytes, getBytes, getBytes, getBytes, getBytes, getChar, getChar, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getShort, getShort, getStringAscii, getStringAscii, getStringAscii, getStringAscii, getStringAscii, getStringAscii, getStringUtf8, getStringUtf8, getStringUtf8, getStringWithoutLengthAscii, getStringWithoutLengthAscii, getStringWithoutLengthUtf8, parseIntAscii, parseLongAscii, parseNaturalIntAscii, parseNaturalLongAscii, wrap, wrap, wrap, wrap, wrap, wrap, wrap, wrapAdjustment
compareTo
boolean isExpandable()
void setMemory(int index, int length, byte value)
index
- at which to start.length
- of the run of bytes to set.value
- the memory will be set to.void putLong(int index, long value, ByteOrder byteOrder)
index
- in bytes for where to put.value
- for at a given index.byteOrder
- of the value when written.void putLong(int index, long value)
index
- in bytes for where to put.value
- for at a given index.void putInt(int index, int value, ByteOrder byteOrder)
index
- in bytes for where to put.value
- to be written.byteOrder
- of the value when written.void putInt(int index, int value)
index
- in bytes for where to put.value
- for at a given index.int putIntAscii(int index, int value)
index
- the offset at which to put the int.value
- the int to write.int putNaturalIntAscii(int index, int value)
index
- the offset at which to put the int.value
- the int to write.void putNaturalPaddedIntAscii(int index, int length, int value) throws NumberFormatException
NumberFormatException
will be thrown.index
- the offset to start encoding at.length
- the maximum length to encode.value
- the value to encode.NumberFormatException
- if the value won't fit within the length.int putNaturalIntAsciiFromEnd(int value, int endExclusive)
value
- the natural number to encode.endExclusive
- index after the last character encoded.int putNaturalLongAscii(int index, long value)
index
- the offset at which to put the int.value
- the int to write.int putLongAscii(int index, long value)
index
- the offset at which to put the int.value
- the int to write.void putDouble(int index, double value, ByteOrder byteOrder)
index
- in bytes for where to put.value
- to be written.byteOrder
- of the value when written.void putDouble(int index, double value)
index
- in bytes for where to put.value
- to be written.void putFloat(int index, float value, ByteOrder byteOrder)
index
- in bytes for where to put.value
- to be written.byteOrder
- of the value when written.void putFloat(int index, float value)
index
- in bytes for where to put.value
- to be written.void putShort(int index, short value, ByteOrder byteOrder)
index
- in bytes for where to put.value
- to be written.byteOrder
- of the value when written.void putShort(int index, short value)
index
- in bytes for where to put.value
- to be written.void putChar(int index, char value, ByteOrder byteOrder)
index
- in bytes for where to put.value
- to be written.byteOrder
- of the value when written.void putChar(int index, char value)
index
- in bytes for where to put.value
- to be written.void putByte(int index, byte value)
index
- in bytes for where to put.value
- to be written.void putBytes(int index, byte[] src)
index
- in the underlying buffer to start from.src
- to be copied to the underlying buffer.void putBytes(int index, byte[] src, int offset, int length)
index
- in the underlying buffer to start from.src
- to be copied to the underlying buffer.offset
- in the supplied buffer to begin the copy.length
- of the supplied buffer to copy.void putBytes(int index, ByteBuffer srcBuffer, int length)
Buffer.position()
for a given length.
The source buffer will have its Buffer.position()
advanced as a result.
index
- in the underlying buffer to start from.srcBuffer
- to copy the bytes from.length
- of the supplied buffer to copy.void putBytes(int index, ByteBuffer srcBuffer, int srcIndex, int length)
The source buffer will not have its Buffer.position()
advanced as a result.
index
- in the underlying buffer to start from.srcBuffer
- to copy the bytes from (does not change position).srcIndex
- in the source buffer from which the copy will begin.length
- of the bytes to be copied.void putBytes(int index, DirectBuffer srcBuffer, int srcIndex, int length)
DirectBuffer
into this MutableDirectBuffer
at given indices.index
- in this buffer to begin putting the bytes.srcBuffer
- from which the bytes will be copied.srcIndex
- in the source buffer from which the byte copy will begin.length
- of the bytes to be copied.int putStringAscii(int index, String value)
index
- at which the String should be encoded.value
- of the String to be encoded.int putStringAscii(int index, String value, ByteOrder byteOrder)
index
- at which the String should be encoded.value
- of the String to be encoded.byteOrder
- for the length prefix.int putStringWithoutLengthAscii(int index, String value)
index
- at which the String begins.value
- of the String to be encoded.int putStringWithoutLengthAscii(int index, String value, int valueOffset, int length)
index
- at which the String begins.value
- of the String to be encoded.valueOffset
- in the value String to begin.length
- of the value String to encode. If this is greater than valueOffset - value length then the
lesser will be used.int putStringUtf8(int index, String value)
index
- at which the String should be encoded.value
- of the String to be encoded.int putStringUtf8(int index, String value, ByteOrder byteOrder)
index
- at which the String should be encoded.value
- of the String to be encoded.byteOrder
- for the length prefix.int putStringUtf8(int index, String value, int maxEncodedLength)
index
- at which the String should be encoded.value
- of the String to be encoded.maxEncodedLength
- to be checked before writing to the buffer.IllegalArgumentException
- if the encoded bytes are greater than maxEncodedLength.int putStringUtf8(int index, String value, ByteOrder byteOrder, int maxEncodedLength)
index
- at which the String should be encoded.value
- of the String to be encoded.byteOrder
- for the length prefix.maxEncodedLength
- to be checked before writing to the buffer.IllegalArgumentException
- if the encoded bytes are greater than maxEncodedLength.int putStringWithoutLengthUtf8(int index, String value)
index
- at which the String begins.value
- of the String to be encoded.Copyright © 2014-2020 Real Logic Limited. All Rights Reserved.