public interface Bytes
byte[]).| Modifier and Type | Method and Description |
|---|---|
static Bytes |
allocate(int size)
Create a new
Bytes instance with a fixed size content. |
byte[] |
array()
Returns the byte array that backs this buffer.
|
byte[] |
arrayCopy()
Returns the copy of range the buffer's back byte array from
0 till writeIndex.
|
int |
capacity()
Returns the number of bytes (octets) this buffer can contain.
|
void |
capacity(int bytes)
Extends or reduces the buffer's capacity.
|
static Bytes |
copy(byte[] bytes)
Copies a byte array into a new
Bytes object. |
static Bytes |
copy(ByteBuffer buffer)
Copies a
ByteBuffer buffer into a new Bytes object. |
byte |
getByte(int index)
Gets a byte at the specified absolute
index in this buffer. |
byte[] |
getBytes(int index)
Returns a byte array from the specified absolute
index
in this buffer till the end of it. |
byte[] |
getBytes(int index,
int length)
Returns a byte array from the specified absolute
index
in this buffer till the index+length index. |
char |
getChar(int index)
Gets a 2-byte UTF-16 character at the specified absolute
index in this buffer. |
double |
getDouble(int index)
Gets a 64-bit floating point number at the specified absolute
index in this buffer. |
float |
getFloat(int index)
Gets a 32-bit floating point number at the specified absolute
index in this buffer. |
int |
getInt(int index)
Gets a 32-bit integer at the specified absolute
index in
this buffer. |
long |
getLong(int index)
Gets a 64-bit long integer at the specified absolute
index in
this buffer. |
short |
getShort(int index)
Gets a 16-bit short integer at the specified absolute
index in
this buffer. |
String |
getString(int index)
Returns a string from the specified absolute
index
in this buffer till the end of it. |
String |
getString(int index,
Charset charset)
Returns a string from the specified absolute
index
in this buffer till the end of it. |
String |
getString(int index,
int length)
Returns a string from the specified absolute
index
in this buffer till the index+length index. |
String |
getString(int index,
int length,
Charset charset)
Returns a string from the specified absolute
index
in this buffer till the index+length index. |
short |
getUnsignedByte(int index)
Gets an unsigned byte at the specified absolute
index in this
buffer. |
long |
getUnsignedInt(int index)
Gets an unsigned 32-bit integer at the specified absolute
index
in this buffer. |
BigInteger |
getUnsignedLong(int index)
Gets a unsigned 64-bit long integer at the specified absolute
index in
this buffer. |
int |
getUnsignedShort(int index)
Gets an unsigned 16-bit short integer at the specified absolute
index in this buffer. |
boolean |
isAutoResizable()
Tells if the buffer is auto resizable or not.
|
boolean |
isReadable()
Returns
true if and only if (this.writerIndex - this.readerIndex)
is greater than 0. |
boolean |
isReadable(int size)
Returns
true if and only if this buffer contains equal to or more than
the specified number of elements. |
boolean |
isWritable()
Returns
true if and only if (this.capacity - this.writerIndex)
is greater than 0. |
boolean |
isWritable(int size)
Returns
true if and only if this buffer has enough room to allow writing
the specified number of elements. |
int |
readableBytes()
Returns the number of readable bytes which is equal to
(this.writerIndex - this.readerIndex). |
byte |
readByte()
Gets a byte at the current
readerIndex and increases
the readerIndex by 1 in this buffer. |
byte[] |
readBytes()
Reads this buffer's data to a newly created byte array starting at
the current
readerIndex and increases the readerIndex
by the number of the readed bytes (= dst.length). |
Bytes |
readBytes(byte[] destination)
Reads this buffer's data to the specified destination starting at
the current
readerIndex and increases the readerIndex
by the number of the readed bytes (= destination.length). |
Bytes |
readBytes(byte[] destination,
int offset,
int length)
Reads this buffer's data to the specified destination starting at
the current
readerIndex and increases the readerIndex
by the number of the readed bytes (= length). |
byte[] |
readBytes(int length)
Reads this buffer's data to a newly created byte array starting at
the current
readerIndex and increases the readerIndex
by the number of the transferred bytes (= length). |
char |
readChar()
Gets a char at the current
readerIndex and increases
the readerIndex by 2 in this buffer. |
double |
readDouble()
Gets a double at the current
readerIndex and increases
the readerIndex by 8 in this buffer. |
int |
readerIndex()
Returns the
readerIndex of this buffer. |
Bytes |
readerIndex(int newIndex)
Sets the
readerIndex of this buffer. |
float |
readFloat()
Gets a float at the current
readerIndex and increases
the readerIndex by 4 in this buffer. |
int |
readInt()
Gets a int at the current
readerIndex and increases
the readerIndex by 4 in this buffer. |
long |
readLong()
Gets a long at the current
readerIndex and increases
the readerIndex by 8 in this buffer. |
static Bytes |
readOnly(byte[] bytes)
Wraps a byte array into a new read-only
Bytes object. |
static Bytes |
readOnly(ByteBuffer buffer)
Wraps a
ByteBuffer buffer into a new read-only Bytes object. |
static Bytes |
readOnly(Bytes delegate)
|
short |
readShort()
Gets a short at the current
readerIndex and increases
the readerIndex by 2 in this buffer. |
String |
readString()
Reads this buffer's data to a string starting at the current
readerIndex and increases the readerIndex
by the number of the readed bytes (= dst.length). |
String |
readString(Charset charset)
Reads this buffer's data to a string starting at the current
readerIndex and increases the readerIndex
by the number of the readed bytes (= dst.length). |
String |
readString(int length)
Reads this buffer's data to a string starting at the current
readerIndex and increases the readerIndex
by the number of the transferred bytes (= length). |
String |
readString(int length,
Charset charset)
Reads this buffer's data to a string starting at the current
readerIndex and increases the readerIndex
by the number of the transferred bytes (= length). |
short |
readUnsignedByte()
Gets an unsigned byte at the current
readerIndex and
increases the readerIndex by 1 in this buffer. |
long |
readUnsignedInt()
Gets an unsigned int at the current
readerIndex and
increases the readerIndex by 4 in this buffer. |
BigInteger |
readUnsignedLong()
Gets an unsigned long at the current
readerIndex and
increases the readerIndex by 8 in this buffer. |
int |
readUnsignedShort()
Gets an unsigned short at the current
readerIndex and
increases the readerIndex by 2 in this buffer. |
Bytes |
reset()
Sets the
readerIndex and writerIndex of this buffer to
0. |
static Bytes |
resizableArray()
Creates a new
Bytes instance with a resizable content. |
static Bytes |
resizableArray(int initialSize)
Creates a new
Bytes instance with a resizable content. |
Bytes |
set1B(int index,
byte value)
Sets the specified byte at the specified absolute
index in this
buffer. |
Bytes |
set1B(int index,
char value)
Sets the specified byte at the specified absolute
index in this
buffer. |
Bytes |
set1B(int index,
double value)
Sets the specified byte at the specified absolute
index in this
buffer. |
Bytes |
set1B(int index,
float value)
Sets the specified byte at the specified absolute
index in this
buffer. |
Bytes |
set1B(int index,
int value)
Sets the specified byte at the specified absolute
index in this
buffer. |
Bytes |
set1B(int index,
long value)
Sets the specified byte at the specified absolute
index in this
buffer. |
Bytes |
set1B(int index,
short value)
Sets the specified byte at the specified absolute
index in this
buffer. |
Bytes |
set2B(int index,
byte value)
Sets the specified 2 byte value at the specified absolute
index in this buffer. |
Bytes |
set2B(int index,
char value)
Sets the specified 2 byte value at the specified absolute
index in this buffer. |
Bytes |
set2B(int index,
double value)
Sets the specified 2 byte value at the specified absolute
index in this buffer. |
Bytes |
set2B(int index,
float value)
Sets the specified 2 byte value at the specified absolute
index in this buffer. |
Bytes |
set2B(int index,
int value)
Sets the specified 2 byte value at the specified absolute
index in this buffer. |
Bytes |
set2B(int index,
long value)
Sets the specified 2 byte value at the specified absolute
index in this buffer. |
Bytes |
set2B(int index,
short value)
Sets the specified 2 byte value at the specified absolute
index in this buffer. |
Bytes |
set4B(int index,
byte value)
Sets the specified 4 byte value at the specified absolute
index in this buffer. |
Bytes |
set4B(int index,
char value)
Sets the specified 4 byte value at the specified absolute
index in this buffer. |
Bytes |
set4B(int index,
double value)
Sets the specified 4 byte value at the specified absolute
index in this buffer. |
Bytes |
set4B(int index,
float value)
Sets the specified 4 byte value at the specified absolute
index in this buffer. |
Bytes |
set4B(int index,
int value)
Sets the specified 4 byte value at the specified absolute
index in this buffer. |
Bytes |
set4B(int index,
long value)
Sets the specified 4 byte value at the specified absolute
index in this buffer. |
Bytes |
set4B(int index,
short value)
Sets the specified 4 byte value at the specified absolute
index in this buffer. |
Bytes |
set8B(int index,
byte value)
Sets the specified 8 byte value at the specified absolute
index in this buffer. |
Bytes |
set8B(int index,
char value)
Sets the specified 8 byte value at the specified absolute
index in this buffer. |
Bytes |
set8B(int index,
double value)
Sets the specified 8 byte value at the specified absolute
index in this buffer. |
Bytes |
set8B(int index,
float value)
Sets the specified 8 byte value at the specified absolute
index in this buffer. |
Bytes |
set8B(int index,
int value)
Sets the specified 8 byte value at the specified absolute
index in this buffer. |
Bytes |
set8B(int index,
long value)
Sets the specified 8 byte value at the specified absolute
index in this buffer. |
Bytes |
set8B(int index,
short value)
Sets the specified 8 byte value at the specified absolute
index in this buffer. |
Bytes |
setNB(int index,
byte[] bytes)
Sets the specified byte array at the specified absolute
index
in this buffer. |
Bytes |
setNB(int index,
byte[] bytes,
int offset)
Sets the specified byte array at the specified absolute
index
in this buffer. |
Bytes |
setNB(int index,
byte[] bytes,
int offset,
int length)
Sets the specified byte array at the specified absolute
index
in this buffer. |
Bytes |
setNB(int index,
String value)
Sets the specified string at the specified absolute
index
in this buffer. |
Bytes |
setNB(int index,
String value,
Charset charset)
Sets the specified string at the specified absolute
index
in this buffer. |
BytesSliceBuilder |
slice()
Creates a new
BytesSliceBuilder instance for making the buffer's slize. |
static Bytes |
wrap(byte[] bytes)
Wraps a byte array into a new
Bytes object. |
static Bytes |
wrap(ByteBuffer buffer)
Wraps a
ByteBuffer buffer into a new Bytes object. |
int |
writableBytes()
Returns the number of writable bytes which is equal to
(this.capacity - this.writerIndex). |
Bytes |
write1B(byte value)
Sets the specified byte at the current
writerIndex
and increases the writerIndex by 1 in this buffer. |
Bytes |
write1B(char value)
Sets the specified byte at the current
writerIndex
and increases the writerIndex by 1 in this buffer. |
Bytes |
write1B(double value)
Sets the specified byte at the current
writerIndex
and increases the writerIndex by 1 in this buffer. |
Bytes |
write1B(float value)
Sets the specified byte at the current
writerIndex
and increases the writerIndex by 1 in this buffer. |
Bytes |
write1B(int value)
Sets the specified byte at the current
writerIndex
and increases the writerIndex by 1 in this buffer. |
Bytes |
write1B(long value)
Sets the specified byte at the current
writerIndex
and increases the writerIndex by 1 in this buffer. |
Bytes |
write1B(short value)
Sets the specified byte at the current
writerIndex
and increases the writerIndex by 1 in this buffer. |
Bytes |
write2B(byte value)
Sets the specified short at the current
writerIndex
and increases the writerIndex by 2 in this buffer. |
Bytes |
write2B(char value)
Sets the specified short at the current
writerIndex
and increases the writerIndex by 2 in this buffer. |
Bytes |
write2B(double value)
Sets the specified short at the current
writerIndex
and increases the writerIndex by 2 in this buffer. |
Bytes |
write2B(float value)
Sets the specified short at the current
writerIndex
and increases the writerIndex by 2 in this buffer. |
Bytes |
write2B(int value)
Sets the specified short at the current
writerIndex
and increases the writerIndex by 2 in this buffer. |
Bytes |
write2B(long value)
Sets the specified short at the current
writerIndex
and increases the writerIndex by 2 in this buffer. |
Bytes |
write2B(short value)
Sets the specified short at the current
writerIndex
and increases the writerIndex by 2 in this buffer. |
Bytes |
write4B(byte value)
Sets the specified int at the current
writerIndex
and increases the writerIndex by 4 in this buffer. |
Bytes |
write4B(char value)
Sets the specified int at the current
writerIndex
and increases the writerIndex by 4 in this buffer. |
Bytes |
write4B(double value)
Sets the specified int at the current
writerIndex
and increases the writerIndex by 4 in this buffer. |
Bytes |
write4B(float value)
Sets the specified int at the current
writerIndex
and increases the writerIndex by 4 in this buffer. |
Bytes |
write4B(int value)
Sets the specified int at the current
writerIndex
and increases the writerIndex by 4 in this buffer. |
Bytes |
write4B(long value)
Sets the specified int at the current
writerIndex
and increases the writerIndex by 4 in this buffer. |
Bytes |
write4B(short value)
Sets the specified int at the current
writerIndex
and increases the writerIndex by 4 in this buffer. |
Bytes |
write8B(byte value)
Sets the specified long at the current
writerIndex
and increases the writerIndex by 8 in this buffer. |
Bytes |
write8B(char value)
Sets the specified long at the current
writerIndex
and increases the writerIndex by 8 in this buffer. |
Bytes |
write8B(double value)
Sets the specified long at the current
writerIndex
and increases the writerIndex by 8 in this buffer. |
Bytes |
write8B(float value)
Sets the specified long at the current
writerIndex
and increases the writerIndex by 8 in this buffer. |
Bytes |
write8B(int value)
Sets the specified long at the current
writerIndex
and increases the writerIndex by 8 in this buffer. |
Bytes |
write8B(long value)
Sets the specified long at the current
writerIndex
and increases the writerIndex by 8 in this buffer. |
Bytes |
write8B(short value)
Sets the specified long at the current
writerIndex
and increases the writerIndex by 8 in this buffer. |
Bytes |
writeNB(byte[] bytes)
Sets the specified byte array at the current
writerIndex
and increases the writerIndex by bytes.length
in this buffer. |
Bytes |
writeNB(byte[] bytes,
int offset)
Sets the specified byte array at the current
writerIndex
and increases the writerIndex by bytes.length-offset
in this buffer. |
Bytes |
writeNB(byte[] bytes,
int offset,
int length)
Sets the specified byte array at the current
writerIndex
and increases the writerIndex by length
in this buffer. |
Bytes |
writeNB(String value)
Sets the specified string at the current
writerIndex
and increases the writerIndex by string.length()
in this buffer. |
Bytes |
writeNB(String value,
Charset charset)
Sets the specified string at the current
writerIndex
and increases the writerIndex by string.length()
in this buffer. |
int |
writerIndex()
Returns the
writerIndex of this buffer. |
Bytes |
writerIndex(int newIndex)
Sets the
writerIndex of this buffer. |
static Bytes wrap(byte[] bytes)
Bytes object.
Modifications to this array's content will cause the wrapped buffer's content to be modified, and vice versa.
bytes - the value to wrapBytes instancestatic Bytes wrap(ByteBuffer buffer)
ByteBuffer buffer into a new Bytes object.
Modifications to this buffer's content will cause the wrapped buffer's content to be modified, and vice versa.
buffer - the value to wrapBytes instancestatic Bytes copy(byte[] bytes)
Bytes object.
Modifications to this array's content will not cause the wrapped buffer's content to be modified, and vice versa.
bytes - the value to copyBytes instancestatic Bytes copy(ByteBuffer buffer)
ByteBuffer buffer into a new Bytes object.
Modifications to this buffer's content will not cause the wrapped buffer's content to be modified, and vice versa.
buffer - the value to copyBytes instancestatic Bytes allocate(int size)
Bytes instance with a fixed size content.size - the size of a new buffer.Bytes instancestatic Bytes resizableArray()
Bytes instance with a resizable content.Bytes instancestatic Bytes resizableArray(int initialSize)
Bytes instance with a resizable content.initialSize - the initial buffer's sizeBytes instancestatic Bytes readOnly(byte[] bytes)
Bytes object.
All modifications are forbidden.
bytes - the value to wrapBytes read-only instancestatic Bytes readOnly(ByteBuffer buffer)
buffer - the value to wrapBytes read-only instancestatic Bytes readOnly(Bytes delegate)
delegate - the value to wrapBytes read-only instanceboolean isAutoResizable()
true if the buffer could be extandable
false otherwiseBytes writeNB(byte[] bytes)
writerIndex
and increases the writerIndex by bytes.length
in this buffer.bytes - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than bytes.lengthBytes writeNB(byte[] bytes, int offset)
writerIndex
and increases the writerIndex by bytes.length-offset
in this buffer.bytes - the value to writeoffset - the first index of the bytesthis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than
bytes.length-offsetBytes writeNB(byte[] bytes, int offset, int length)
writerIndex
and increases the writerIndex by length
in this buffer.bytes - the value to writeoffset - the first index of the byteslength - the number of bytes to readthis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than lengthBytes writeNB(String value)
writerIndex
and increases the writerIndex by string.length()
in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than bytes.length()Bytes writeNB(String value, Charset charset)
writerIndex
and increases the writerIndex by string.length()
in this buffer.value - the value to writecharset - the string's charsetthis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than bytes.length()Bytes write1B(byte value)
writerIndex
and increases the writerIndex by 1 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 1Bytes write1B(short value)
writerIndex
and increases the writerIndex by 1 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 1Bytes write1B(int value)
writerIndex
and increases the writerIndex by 1 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 1Bytes write1B(long value)
writerIndex
and increases the writerIndex by 1 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 1Bytes write1B(float value)
writerIndex
and increases the writerIndex by 1 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 1Bytes write1B(double value)
writerIndex
and increases the writerIndex by 1 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 1Bytes write1B(char value)
writerIndex
and increases the writerIndex by 1 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 1Bytes write2B(byte value)
writerIndex
and increases the writerIndex by 2 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 2Bytes write2B(short value)
writerIndex
and increases the writerIndex by 2 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 2Bytes write2B(int value)
writerIndex
and increases the writerIndex by 2 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 2Bytes write2B(long value)
writerIndex
and increases the writerIndex by 2 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 2Bytes write2B(float value)
writerIndex
and increases the writerIndex by 2 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 2Bytes write2B(double value)
writerIndex
and increases the writerIndex by 2 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 2Bytes write2B(char value)
writerIndex
and increases the writerIndex by 2 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 2Bytes write4B(byte value)
writerIndex
and increases the writerIndex by 4 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 4Bytes write4B(short value)
writerIndex
and increases the writerIndex by 4 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 4Bytes write4B(int value)
writerIndex
and increases the writerIndex by 4 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 4Bytes write4B(long value)
writerIndex
and increases the writerIndex by 4 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 4Bytes write4B(float value)
writerIndex
and increases the writerIndex by 4 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 4Bytes write4B(double value)
writerIndex
and increases the writerIndex by 4 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 4Bytes write4B(char value)
writerIndex
and increases the writerIndex by 4 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 4Bytes write8B(byte value)
writerIndex
and increases the writerIndex by 8 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 8Bytes write8B(short value)
writerIndex
and increases the writerIndex by 8 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 8Bytes write8B(int value)
writerIndex
and increases the writerIndex by 8 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 8Bytes write8B(long value)
writerIndex
and increases the writerIndex by 8 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 8Bytes write8B(float value)
writerIndex
and increases the writerIndex by 8 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 8Bytes write8B(double value)
writerIndex
and increases the writerIndex by 8 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 8Bytes write8B(char value)
writerIndex
and increases the writerIndex by 8 in this buffer.value - the value to writethis object for chaining callsIndexOutOfBoundsException - if this.writableBytes is less than 8Bytes setNB(int index, byte[] bytes)
index
in this buffer. This method does not modify readerIndex or
writerIndex of this buffer.index - the index to which the byte will be setbytes - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 1 is greater than this.capacityBytes setNB(int index, byte[] bytes, int offset)
index
in this buffer. This method does not modify readerIndex or
writerIndex of this buffer.index - the index to which the byte will be setbytes - the value for setoffset - the first index of the valuethis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 1 is greater than this.capacityBytes setNB(int index, byte[] bytes, int offset, int length)
index
in this buffer. This method does not modify readerIndex or
writerIndex of this buffer.index - the index to which the byte will be setbytes - the value for setoffset - the first index of the valuelength - the number of bytes to setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 1 is greater than this.capacityBytes setNB(int index, String value)
index
in this buffer. This method does not modify readerIndex or
writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 1 is greater than this.capacityBytes setNB(int index, String value, Charset charset)
index
in this buffer. This method does not modify readerIndex or
writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setcharset - the string's charsetthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 1 is greater than this.capacityBytes set1B(int index, byte value)
index in this
buffer. This method does not modify readerIndex or
writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 1 is greater than this.capacityBytes set1B(int index, short value)
index in this
buffer. This method does not modify readerIndex or
writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 1 is greater than this.capacityBytes set1B(int index, int value)
index in this
buffer. This method does not modify readerIndex or
writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 1 is greater than this.capacityBytes set1B(int index, long value)
index in this
buffer. This method does not modify readerIndex or
writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 1 is greater than this.capacityBytes set1B(int index, float value)
index in this
buffer. This method does not modify readerIndex or
writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 1 is greater than this.capacityBytes set1B(int index, double value)
index in this
buffer. This method does not modify readerIndex or
writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 1 is greater than this.capacityBytes set1B(int index, char value)
index in this
buffer. This method does not modify readerIndex or
writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 1 is greater than this.capacityBytes set2B(int index, byte value)
index in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 2 is greater than this.capacityBytes set2B(int index, short value)
index in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 2 is greater than this.capacityBytes set2B(int index, int value)
index in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 2 is greater than this.capacityBytes set2B(int index, long value)
index in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 2 is greater than this.capacityBytes set2B(int index, float value)
index in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 2 is greater than this.capacityBytes set2B(int index, double value)
index in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 2 is greater than this.capacityBytes set2B(int index, char value)
index in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 2 is greater than this.capacityBytes set4B(int index, byte value)
index in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 4 is greater than this.capacityBytes set4B(int index, short value)
index in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 4 is greater than this.capacityBytes set4B(int index, int value)
index in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 4 is greater than this.capacityBytes set4B(int index, long value)
index in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 4 is greater than this.capacityBytes set4B(int index, float value)
index in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 4 is greater than this.capacityBytes set4B(int index, double value)
index in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 4 is greater than this.capacityBytes set4B(int index, char value)
index in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 4 is greater than this.capacityBytes set8B(int index, byte value)
index in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 8 is greater than this.capacityBytes set8B(int index, short value)
index in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 8 is greater than this.capacityBytes set8B(int index, int value)
index in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 8 is greater than this.capacityBytes set8B(int index, long value)
index in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 8 is greater than this.capacityBytes set8B(int index, float value)
index in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 8 is greater than this.capacityBytes set8B(int index, double value)
index in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 8 is greater than this.capacityBytes set8B(int index, char value)
index in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index to which the byte will be setvalue - the value for setthis object for chaining callsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 8 is greater than this.capacitybyte readByte()
readerIndex and increases
the readerIndex by 1 in this buffer.IndexOutOfBoundsException - if this.readableBytes is less than 1short readUnsignedByte()
readerIndex and
increases the readerIndex by 1 in this buffer.IndexOutOfBoundsException - if this.readableBytes is less than 1short readShort()
readerIndex and increases
the readerIndex by 2 in this buffer.IndexOutOfBoundsException - if this.readableBytes is less than 2int readUnsignedShort()
readerIndex and
increases the readerIndex by 2 in this buffer.IndexOutOfBoundsException - if this.readableBytes is less than 2int readInt()
readerIndex and increases
the readerIndex by 4 in this buffer.IndexOutOfBoundsException - if this.readableBytes is less than 4long readUnsignedInt()
readerIndex and
increases the readerIndex by 4 in this buffer.IndexOutOfBoundsException - if this.readableBytes is less than 4long readLong()
readerIndex and increases
the readerIndex by 8 in this buffer.IndexOutOfBoundsException - if this.readableBytes is less than 8BigInteger readUnsignedLong()
readerIndex and
increases the readerIndex by 8 in this buffer.IndexOutOfBoundsException - if this.readableBytes is less than 8float readFloat()
readerIndex and increases
the readerIndex by 4 in this buffer.IndexOutOfBoundsException - if this.readableBytes is less than 4double readDouble()
readerIndex and increases
the readerIndex by 8 in this buffer.IndexOutOfBoundsException - if this.readableBytes is less than 8char readChar()
readerIndex and increases
the readerIndex by 2 in this buffer.IndexOutOfBoundsException - if this.readableBytes is less than 2byte[] readBytes()
readerIndex and increases the readerIndex
by the number of the readed bytes (= dst.length).byte[] readBytes(int length)
readerIndex and increases the readerIndex
by the number of the transferred bytes (= length).length - the number of bytes to transferIndexOutOfBoundsException - if length is greater than this.readableBytesBytes readBytes(byte[] destination)
readerIndex and increases the readerIndex
by the number of the readed bytes (= destination.length).destination - the byte array to read intothis object for chaining callsIndexOutOfBoundsException - if destination.length is greater than this.readableBytesBytes readBytes(byte[] destination, int offset, int length)
readerIndex and increases the readerIndex
by the number of the readed bytes (= length).destination - the byte array to read intooffset - the first index of the destinationlength - the number of bytes to readthis object for chaining callsIndexOutOfBoundsException - if the specified offset is less than 0,
if length is greater than this.readableBytes, or
if offset + length is greater than destination.lengthString readString()
readerIndex and increases the readerIndex
by the number of the readed bytes (= dst.length).String readString(Charset charset)
readerIndex and increases the readerIndex
by the number of the readed bytes (= dst.length).charset - the string's charsetString readString(int length)
readerIndex and increases the readerIndex
by the number of the transferred bytes (= length).length - the number of bytes to transferIndexOutOfBoundsException - if length is greater than this.readableBytesString readString(int length, Charset charset)
readerIndex and increases the readerIndex
by the number of the transferred bytes (= length).length - the number of bytes to transfercharset - the string's charsetIndexOutOfBoundsException - if length is greater than this.readableBytesbyte getByte(int index)
index in this buffer.
This method does not modify readerIndex or writerIndex of
this buffer.index - the index from which the byte will be readIndexOutOfBoundsException - if the specified index is less than 0 or
index + 1 is greater than this.capacityshort getUnsignedByte(int index)
index in this
buffer. This method does not modify readerIndex or
writerIndex of this buffer.index - the index from which the unsigned byte will be readIndexOutOfBoundsException - if the specified index is less than 0 or
index + 1 is greater than this.capacityshort getShort(int index)
index in
this buffer. This method does not modify readerIndex or
writerIndex of this buffer.index - the index from which the short will be readIndexOutOfBoundsException - if the specified index is less than 0 or
index + 2 is greater than this.capacityint getUnsignedShort(int index)
index in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index from which the unsigned short will be readIndexOutOfBoundsException - if the specified index is less than 0 or
index + 2 is greater than this.capacityint getInt(int index)
index in
this buffer. This method does not modify readerIndex or
writerIndex of this buffer.index - the index from which the int will be readIndexOutOfBoundsException - if the specified index is less than 0 or
index + 4 is greater than this.capacitylong getUnsignedInt(int index)
index
in this buffer. This method does not modify readerIndex or
writerIndex of this buffer.index - the index from which the unsigned int will be readIndexOutOfBoundsException - if the specified index is less than 0 or
index + 4 is greater than this.capacitylong getLong(int index)
index in
this buffer. This method does not modify readerIndex or
writerIndex of this buffer.index - the index from which the long will be readIndexOutOfBoundsException - if the specified index is less than 0 or
index + 8 is greater than this.capacityBigInteger getUnsignedLong(int index)
index in
this buffer. This method does not modify readerIndex or
writerIndex of this buffer.index - the index from which the unsigned long will be readIndexOutOfBoundsException - if the specified index is less than 0 or
index + 8 is greater than this.capacityfloat getFloat(int index)
index in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index from which the float will be readIndexOutOfBoundsException - if the specified index is less than 0 or
index + 4 is greater than this.capacitydouble getDouble(int index)
index in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index from which the double will be readIndexOutOfBoundsException - if the specified index is less than 0 or
index + 8 is greater than this.capacitychar getChar(int index)
index in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index from which the char will be readIndexOutOfBoundsException - if the specified index is less than 0 or
index + 2 is greater than this.capacitybyte[] getBytes(int index)
index
in this buffer till the end of it. This method does not modify
readerIndex or writerIndex of this buffer.index - the index from which the byte array will be readIndexOutOfBoundsException - if the specified index is less than 0 or
index + 2 is greater than this.capacitybyte[] getBytes(int index,
int length)
index
in this buffer till the index+length index.
This method does not modify readerIndex or
writerIndex of this buffer.index - the index from which the byte array will be readlength - the number of bytes to returnsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 2 is greater than this.capacityString getString(int index)
index
in this buffer till the end of it. This method does not modify
readerIndex or writerIndex of this buffer.index - the index from which the string will be readIndexOutOfBoundsException - if the specified index is less than 0 or
index + 2 is greater than this.capacityString getString(int index, Charset charset)
index
in this buffer till the end of it. This method does not modify
readerIndex or writerIndex of this buffer.index - the index from which the string will be readcharset - the string's charsetIndexOutOfBoundsException - if the specified index is less than 0 or
index + 2 is greater than this.capacityString getString(int index, int length)
index
in this buffer till the index+length index.
This method does not modify readerIndex or
writerIndex of this buffer.index - the index from which the string will be readlength - the number of bytes to returnsIndexOutOfBoundsException - if the specified index is less than 0 or
index + 2 is greater than this.capacityString getString(int index, int length, Charset charset)
index
in this buffer till the index+length index.
This method does not modify readerIndex or
writerIndex of this buffer.index - the index from which the string will be readlength - the number of bytes to returnscharset - the string's charsetIndexOutOfBoundsException - if the specified index is less than 0 or
index + 2 is greater than this.capacityint capacity()
void capacity(int bytes)
bytes - the new buffer's capacityint writerIndex()
writerIndex of this buffer.writerIndexBytes writerIndex(int newIndex)
writerIndex of this buffer.newIndex - a new index valuethis object for chaining callsIndexOutOfBoundsException - if the specified writerIndex is
less than this.readerIndex or
greater than this.capacityint writableBytes()
(this.capacity - this.writerIndex).boolean isWritable()
true if and only if (this.capacity - this.writerIndex)
is greater than 0.true if it is possible to write more bytes,
false otherwiseboolean isWritable(int size)
true if and only if this buffer has enough room to allow writing
the specified number of elements.size - the specified number bytes need to writetrue if it is possible to write the specified number of bytes,
false otherwiseint readerIndex()
readerIndex of this buffer.readerIndexBytes readerIndex(int newIndex)
readerIndex of this buffer.newIndex - a new index valuethis object for chaining callsIndexOutOfBoundsException - if the specified readerIndex is
less than 0 or
greater than this.writerIndexint readableBytes()
(this.writerIndex - this.readerIndex).boolean isReadable()
true if and only if (this.writerIndex - this.readerIndex)
is greater than 0.true if it is possible to read more,
false otherwiseboolean isReadable(int size)
true if and only if this buffer contains equal to or more than
the specified number of elements.size - the specified number bytes need to readtrue if it is possible to read the specified number of bytes,
false otherwiseBytes reset()
readerIndex and writerIndex of this buffer to
0.this object for chaining callsbyte[] array()
Modifications to this buffer's content may cause the returned array's content to be modified, and vice versa.
byte[] arrayCopy()
Modifications to this buffer's content may NOT cause the returned array's content to be modified, and vice versa.
BytesSliceBuilder slice()
BytesSliceBuilder instance for making the buffer's slize.BytesSliceBuilder instanceCopyright © 2019–2020 Appulse. All rights reserved.