| Modifier and Type | Method and Description |
|---|---|
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.
|
protected void |
checkReaderBounds(int index,
int length) |
protected void |
checkWriteBounds(int index,
int length) |
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(@NonNull 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. |
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. |
void |
release()
Releases the
this Bytes instance in its pool back. |
Bytes |
reset()
Sets the
readerIndex and writerIndex of this buffer to
0. |
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,
@NonNull byte[] bytes)
Sets the specified byte array at the specified absolute
index
in this buffer. |
Bytes |
setNB(int index,
@NonNull 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,
@NonNull String value,
@NonNull Charset charset)
Sets the specified string at the specified absolute
index
in this buffer. |
String |
toString() |
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(@NonNull byte[] bytes)
Sets the specified byte array at the current
writerIndex
and increases the writerIndex by bytes.length
in this buffer. |
Bytes |
writeNB(@NonNull 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(@NonNull String value,
@NonNull 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. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitallocate, copy, copy, resizableArray, resizableArray, wrap, wrappublic void release()
this Bytes instance in its pool back.public boolean isAutoResizable()
Bytestrue if the buffer could be extandable
false otherwisepublic Bytes writeNB(byte[] bytes, int offset, int length)
ByteswriterIndex
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 callspublic Bytes write1B(byte value)
ByteswriterIndex
and increases the writerIndex by 1 in this buffer.value - the value to writethis object for chaining callspublic Bytes write2B(short value)
ByteswriterIndex
and increases the writerIndex by 2 in this buffer.value - the value to writethis object for chaining callspublic Bytes write4B(int value)
ByteswriterIndex
and increases the writerIndex by 4 in this buffer.value - the value to writethis object for chaining callspublic Bytes write8B(long value)
ByteswriterIndex
and increases the writerIndex by 8 in this buffer.value - the value to writethis object for chaining callspublic Bytes setNB(int index, byte[] bytes, int offset, int length)
Bytesindex
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 callspublic Bytes set1B(int index, byte value)
Bytesindex 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 callspublic Bytes set2B(int index, short value)
Bytesindex 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 callspublic Bytes set4B(int index, int value)
Bytesindex 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 callspublic Bytes set8B(int index, long value)
Bytesindex 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 callspublic byte readByte()
BytesreaderIndex and increases
the readerIndex by 1 in this buffer.public short readShort()
BytesreaderIndex and increases
the readerIndex by 2 in this buffer.public int readInt()
BytesreaderIndex and increases
the readerIndex by 4 in this buffer.public long readLong()
BytesreaderIndex and increases
the readerIndex by 8 in this buffer.public float readFloat()
BytesreaderIndex and increases
the readerIndex by 4 in this buffer.public double readDouble()
BytesreaderIndex and increases
the readerIndex by 8 in this buffer.public char readChar()
BytesreaderIndex and increases
the readerIndex by 2 in this buffer.public Bytes readBytes(byte[] destination, int offset, int length)
BytesreaderIndex 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 callspublic byte getByte(int index)
Bytesindex in this buffer.
This method does not modify readerIndex or writerIndex of
this buffer.index - the index from which the byte will be readpublic short getShort(int index)
Bytesindex in
this buffer. This method does not modify readerIndex or
writerIndex of this buffer.index - the index from which the short will be readpublic int getInt(int index)
Bytesindex in
this buffer. This method does not modify readerIndex or
writerIndex of this buffer.index - the index from which the int will be readpublic long getLong(int index)
Bytesindex in
this buffer. This method does not modify readerIndex or
writerIndex of this buffer.index - the index from which the long will be readpublic float getFloat(int index)
Bytesindex in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index from which the float will be readpublic double getDouble(int index)
Bytesindex in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index from which the double will be readpublic char getChar(int index)
Bytesindex in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.index - the index from which the char will be readpublic byte[] getBytes(int index,
int length)
Bytesindex
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 returnspublic String getString(int index, int length, Charset charset)
Bytesindex
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 charsetpublic int capacity()
Bytespublic void capacity(int bytes)
Bytesbytes - the new buffer's capacitypublic int writerIndex()
ByteswriterIndex of this buffer.writerIndexpublic Bytes writerIndex(int newIndex)
ByteswriterIndex of this buffer.newIndex - a new index valuethis object for chaining callspublic int readerIndex()
BytesreaderIndex of this buffer.readerIndexpublic Bytes readerIndex(int newIndex)
BytesreaderIndex of this buffer.newIndex - a new index valuethis object for chaining callspublic byte[] array()
BytesModifications to this buffer's content may cause the returned array's content to be modified, and vice versa.
public Bytes writeNB(@NonNull @NonNull byte[] bytes)
ByteswriterIndex
and increases the writerIndex by bytes.length
in this buffer.public Bytes writeNB(@NonNull @NonNull byte[] bytes, int offset)
ByteswriterIndex
and increases the writerIndex by bytes.length-offset
in this buffer.public Bytes writeNB(String value)
ByteswriterIndex
and increases the writerIndex by string.length()
in this buffer.public Bytes writeNB(@NonNull @NonNull String value, @NonNull @NonNull Charset charset)
ByteswriterIndex
and increases the writerIndex by string.length()
in this buffer.public Bytes write1B(short value)
ByteswriterIndex
and increases the writerIndex by 1 in this buffer.public Bytes write1B(int value)
ByteswriterIndex
and increases the writerIndex by 1 in this buffer.public Bytes write1B(long value)
ByteswriterIndex
and increases the writerIndex by 1 in this buffer.public Bytes write1B(float value)
ByteswriterIndex
and increases the writerIndex by 1 in this buffer.public Bytes write1B(double value)
ByteswriterIndex
and increases the writerIndex by 1 in this buffer.public Bytes write1B(char value)
ByteswriterIndex
and increases the writerIndex by 1 in this buffer.public Bytes write2B(byte value)
ByteswriterIndex
and increases the writerIndex by 2 in this buffer.public Bytes write2B(int value)
ByteswriterIndex
and increases the writerIndex by 2 in this buffer.public Bytes write2B(long value)
ByteswriterIndex
and increases the writerIndex by 2 in this buffer.public Bytes write2B(float value)
ByteswriterIndex
and increases the writerIndex by 2 in this buffer.public Bytes write2B(double value)
ByteswriterIndex
and increases the writerIndex by 2 in this buffer.public Bytes write2B(char value)
ByteswriterIndex
and increases the writerIndex by 2 in this buffer.public Bytes write4B(byte value)
ByteswriterIndex
and increases the writerIndex by 4 in this buffer.public Bytes write4B(short value)
ByteswriterIndex
and increases the writerIndex by 4 in this buffer.public Bytes write4B(long value)
ByteswriterIndex
and increases the writerIndex by 4 in this buffer.public Bytes write4B(float value)
ByteswriterIndex
and increases the writerIndex by 4 in this buffer.public Bytes write4B(double value)
ByteswriterIndex
and increases the writerIndex by 4 in this buffer.public Bytes write4B(char value)
ByteswriterIndex
and increases the writerIndex by 4 in this buffer.public Bytes write8B(byte value)
ByteswriterIndex
and increases the writerIndex by 8 in this buffer.public Bytes write8B(short value)
ByteswriterIndex
and increases the writerIndex by 8 in this buffer.public Bytes write8B(int value)
ByteswriterIndex
and increases the writerIndex by 8 in this buffer.public Bytes write8B(float value)
ByteswriterIndex
and increases the writerIndex by 8 in this buffer.public Bytes write8B(double value)
ByteswriterIndex
and increases the writerIndex by 8 in this buffer.public Bytes write8B(char value)
ByteswriterIndex
and increases the writerIndex by 8 in this buffer.public Bytes setNB(int index, @NonNull @NonNull byte[] bytes)
Bytesindex
in this buffer. This method does not modify readerIndex or
writerIndex of this buffer.public Bytes setNB(int index, @NonNull @NonNull byte[] bytes, int offset)
Bytesindex
in this buffer. This method does not modify readerIndex or
writerIndex of this buffer.public Bytes setNB(int index, String value)
Bytesindex
in this buffer. This method does not modify readerIndex or
writerIndex of this buffer.public Bytes setNB(int index, @NonNull @NonNull String value, @NonNull @NonNull Charset charset)
Bytesindex
in this buffer. This method does not modify readerIndex or
writerIndex of this buffer.public Bytes set1B(int index, short value)
Bytesindex in this
buffer. This method does not modify readerIndex or
writerIndex of this buffer.public Bytes set1B(int index, int value)
Bytesindex in this
buffer. This method does not modify readerIndex or
writerIndex of this buffer.public Bytes set1B(int index, long value)
Bytesindex in this
buffer. This method does not modify readerIndex or
writerIndex of this buffer.public Bytes set1B(int index, float value)
Bytesindex in this
buffer. This method does not modify readerIndex or
writerIndex of this buffer.public Bytes set1B(int index, double value)
Bytesindex in this
buffer. This method does not modify readerIndex or
writerIndex of this buffer.public Bytes set1B(int index, char value)
Bytesindex in this
buffer. This method does not modify readerIndex or
writerIndex of this buffer.public Bytes set2B(int index, byte value)
Bytesindex in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.public Bytes set2B(int index, int value)
Bytesindex in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.public Bytes set2B(int index, long value)
Bytesindex in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.public Bytes set2B(int index, float value)
Bytesindex in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.public Bytes set2B(int index, double value)
Bytesindex in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.public Bytes set2B(int index, char value)
Bytesindex in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.public Bytes set4B(int index, byte value)
Bytesindex in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.public Bytes set4B(int index, short value)
Bytesindex in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.public Bytes set4B(int index, long value)
Bytesindex in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.public Bytes set4B(int index, float value)
Bytesindex in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.public Bytes set4B(int index, double value)
Bytesindex in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.public Bytes set4B(int index, char value)
Bytesindex in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.public Bytes set8B(int index, byte value)
Bytesindex in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.public Bytes set8B(int index, short value)
Bytesindex in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.public Bytes set8B(int index, int value)
Bytesindex in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.public Bytes set8B(int index, float value)
Bytesindex in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.public Bytes set8B(int index, double value)
Bytesindex in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.public Bytes set8B(int index, char value)
Bytesindex in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.public short readUnsignedByte()
BytesreaderIndex and
increases the readerIndex by 1 in this buffer.readUnsignedByte in interface Bytespublic int readUnsignedShort()
BytesreaderIndex and
increases the readerIndex by 2 in this buffer.readUnsignedShort in interface Bytespublic long readUnsignedInt()
BytesreaderIndex and
increases the readerIndex by 4 in this buffer.readUnsignedInt in interface Bytespublic BigInteger readUnsignedLong()
BytesreaderIndex and
increases the readerIndex by 8 in this buffer.readUnsignedLong in interface Bytespublic byte[] readBytes()
BytesreaderIndex and increases the readerIndex
by the number of the readed bytes (= dst.length).public byte[] readBytes(int length)
BytesreaderIndex and increases the readerIndex
by the number of the transferred bytes (= length).public Bytes readBytes(@NonNull @NonNull byte[] destination)
BytesreaderIndex and increases the readerIndex
by the number of the readed bytes (= destination.length).public String readString()
BytesreaderIndex and increases the readerIndex
by the number of the readed bytes (= dst.length).readString in interface Bytespublic String readString(int length)
BytesreaderIndex and increases the readerIndex
by the number of the transferred bytes (= length).readString in interface Byteslength - the number of bytes to transferpublic String readString(Charset charset)
BytesreaderIndex and increases the readerIndex
by the number of the readed bytes (= dst.length).readString in interface Bytescharset - the string's charsetpublic String readString(int length, Charset charset)
BytesreaderIndex and increases the readerIndex
by the number of the transferred bytes (= length).readString in interface Byteslength - the number of bytes to transfercharset - the string's charsetpublic short getUnsignedByte(int index)
Bytesindex in this
buffer. This method does not modify readerIndex or
writerIndex of this buffer.getUnsignedByte in interface Bytesindex - the index from which the unsigned byte will be readpublic int getUnsignedShort(int index)
Bytesindex in this buffer. This method does not modify
readerIndex or writerIndex of this buffer.getUnsignedShort in interface Bytesindex - the index from which the unsigned short will be readpublic long getUnsignedInt(int index)
Bytesindex
in this buffer. This method does not modify readerIndex or
writerIndex of this buffer.getUnsignedInt in interface Bytesindex - the index from which the unsigned int will be readpublic BigInteger getUnsignedLong(int index)
Bytesindex in
this buffer. This method does not modify readerIndex or
writerIndex of this buffer.getUnsignedLong in interface Bytesindex - the index from which the unsigned long will be readpublic byte[] getBytes(int index)
Bytesindex
in this buffer till the end of it. This method does not modify
readerIndex or writerIndex of this buffer.public String getString(int index)
Bytesindex
in this buffer till the end of it. This method does not modify
readerIndex or writerIndex of this buffer.public String getString(int index, Charset charset)
Bytesindex
in this buffer till the end of it. This method does not modify
readerIndex or writerIndex of this buffer.public String getString(int index, int length)
Bytesindex
in this buffer till the index+length index.
This method does not modify readerIndex or
writerIndex of this buffer.public int readableBytes()
Bytes(this.writerIndex - this.readerIndex).readableBytes in interface Bytespublic boolean isReadable()
Bytestrue if and only if (this.writerIndex - this.readerIndex)
is greater than 0.isReadable in interface Bytestrue if it is possible to read more,
false otherwisepublic boolean isReadable(int size)
Bytestrue if and only if this buffer contains equal to or more than
the specified number of elements.isReadable in interface Bytessize - the specified number bytes need to readtrue if it is possible to read the specified number of bytes,
false otherwisepublic int writableBytes()
Bytes(this.capacity - this.writerIndex).writableBytes in interface Bytespublic boolean isWritable()
Bytestrue if and only if (this.capacity - this.writerIndex)
is greater than 0.isWritable in interface Bytestrue if it is possible to write more bytes,
false otherwisepublic boolean isWritable(int size)
Bytestrue if and only if this buffer has enough room to allow writing
the specified number of elements.isWritable in interface Bytessize - the specified number bytes need to writetrue if it is possible to write the specified number of bytes,
false otherwisepublic Bytes reset()
BytesreaderIndex and writerIndex of this buffer to
0.public byte[] arrayCopy()
BytesModifications to this buffer's content may NOT cause the returned array's content to be modified, and vice versa.
protected void checkWriteBounds(int index,
int length)
protected void checkReaderBounds(int index,
int length)
Copyright © 2019 Appulse. All rights reserved.