| Constructor and Description |
|---|
BufferImpl() |
| Modifier and Type | Method and Description |
|---|---|
Buffer |
appendBuffer(Buffer buff)
Appends the specified
Buffer to the end of this Buffer. |
Buffer |
appendBuffer(Buffer buff,
int offset,
int len)
Appends the specified
Buffer starting at the offset using len to the end of this Buffer. |
Buffer |
appendByte(byte b)
Appends the specified
byte to the end of the Buffer. |
Buffer |
appendBytes(byte[] bytes)
Appends the specified
byte[] to the end of the Buffer. |
Buffer |
appendBytes(byte[] bytes,
int offset,
int len)
Appends the specified number of bytes from
byte[] to the end of the Buffer, starting at the given offset. |
Buffer |
appendDouble(double d)
Appends the specified
double to the end of the Buffer. |
Buffer |
appendFloat(float f)
Appends the specified
float to the end of the Buffer. |
Buffer |
appendInt(int i)
Appends the specified
int to the end of the Buffer. |
Buffer |
appendIntLE(int i)
Appends the specified
int to the end of the Buffer in the Little Endian Byte Order. |
Buffer |
appendLong(long l)
Appends the specified
long to the end of the Buffer. |
Buffer |
appendLongLE(long l)
Appends the specified
long to the end of the Buffer in the Little Endian Byte Order. |
Buffer |
appendMedium(int i)
Appends the specified 24bit
int to the end of the Buffer. |
Buffer |
appendMediumLE(int i)
Appends the specified 24bit
int to the end of the Buffer in the Little Endian Byte Order. |
Buffer |
appendShort(short s)
Appends the specified
short to the end of the Buffer.The buffer will expand as necessary to accommodate any bytes written. |
Buffer |
appendShortLE(short s)
Appends the specified
short to the end of the Buffer in the Little Endian Byte Order.The buffer will expand as necessary to accommodate any bytes written. |
Buffer |
appendString(String str)
Appends the specified
String str to the end of the Buffer with UTF-8 encoding. |
Buffer |
appendString(String str,
String enc)
Appends the specified
String to the end of the Buffer with the encoding as specified by enc. |
Buffer |
appendUnsignedByte(short b)
Appends the specified unsigned
byte to the end of the Buffer. |
Buffer |
appendUnsignedInt(long i)
Appends the specified unsigned
int to the end of the Buffer. |
Buffer |
appendUnsignedIntLE(long i)
Appends the specified unsigned
int to the end of the Buffer in the Little Endian Byte Order. |
Buffer |
appendUnsignedShort(int s)
Appends the specified unsigned
short to the end of the Buffer.The buffer will expand as necessary to accommodate any bytes written. |
Buffer |
appendUnsignedShortLE(int s)
Appends the specified unsigned
short to the end of the Buffer in the Little Endian Byte Order.The buffer will expand as necessary to accommodate any bytes written. |
Buffer |
copy()
Returns a copy of the entire Buffer.
|
boolean |
equals(Object o) |
Buffer |
getBuffer(int start,
int end)
Returns a copy of a sub-sequence the Buffer as a
Buffer starting at position start
and ending at position end - 1 |
byte |
getByte(int pos)
Returns the
byte at position pos in the Buffer. |
io.netty.buffer.ByteBuf |
getByteBuf()
Returns the Buffer as a Netty
ByteBuf. |
byte[] |
getBytes()
Returns a copy of the entire Buffer as a
byte[] |
Buffer |
getBytes(byte[] dst)
Transfers the content of the Buffer into a
byte[]. |
Buffer |
getBytes(byte[] dst,
int dstIndex)
Transfers the content of the Buffer into a
byte[] at the specific destination. |
byte[] |
getBytes(int start,
int end)
Returns a copy of a sub-sequence the Buffer as a
byte[] starting at position start
and ending at position end - 1 |
Buffer |
getBytes(int start,
int end,
byte[] dst)
Transfers the content of the Buffer starting at position
start and ending at position end - 1
into a byte[]. |
Buffer |
getBytes(int start,
int end,
byte[] dst,
int dstIndex)
Transfers the content of the Buffer starting at position
start and ending at position end - 1
into a byte[] at the specific destination. |
double |
getDouble(int pos)
Returns the
double at position pos in the Buffer. |
float |
getFloat(int pos)
Returns the
float at position pos in the Buffer. |
int |
getInt(int pos)
Returns the
int at position pos in the Buffer. |
int |
getIntLE(int pos)
Gets a 32-bit integer at the specified absolute
index in this buffer with Little Endian Byte Order. |
long |
getLong(int pos)
Returns the
long at position pos in the Buffer. |
long |
getLongLE(int pos)
Gets a 64-bit long integer at the specified absolute
index in this buffer in Little Endian Byte Order. |
int |
getMedium(int pos)
Gets a 24-bit medium integer at the specified absolute
index in this buffer. |
int |
getMediumLE(int pos)
Gets a 24-bit medium integer at the specified absolute
index in this buffer in the Little Endian Byte Order. |
short |
getShort(int pos)
Returns the
short at position pos in the Buffer. |
short |
getShortLE(int pos)
Gets a 16-bit short integer at the specified absolute
index in this buffer in Little Endian Byte Order. |
String |
getString(int start,
int end)
Returns a copy of a sub-sequence the Buffer as a
String starting at position start
and ending at position end - 1 interpreted as a String in UTF-8 encoding |
String |
getString(int start,
int end,
String enc)
Returns a copy of a sub-sequence the Buffer as a
String starting at position start
and ending at position end - 1 interpreted as a String in the specified encoding |
short |
getUnsignedByte(int pos)
Returns the unsigned
byte at position pos in the Buffer, as a short. |
long |
getUnsignedInt(int pos)
Returns the unsigned
int at position pos in the Buffer, as a long. |
long |
getUnsignedIntLE(int pos)
Returns the unsigned
int at position pos in the Buffer, as a long in Little Endian Byte Order. |
int |
getUnsignedMedium(int pos)
Gets an unsigned 24-bit medium integer at the specified absolute
index in this buffer. |
int |
getUnsignedMediumLE(int pos)
Gets an unsigned 24-bit medium integer at the specified absolute
index in this buffer in Little Endian Byte Order. |
int |
getUnsignedShort(int pos)
Returns the unsigned
short at position pos in the Buffer, as an int. |
int |
getUnsignedShortLE(int pos)
Gets an unsigned 16-bit short integer at the specified absolute
index in this buffer in Little Endian Byte Order. |
int |
hashCode() |
int |
length()
Returns the length of the buffer, measured in bytes.
|
int |
readFromBuffer(int pos,
Buffer buffer) |
Buffer |
setBuffer(int pos,
Buffer b)
Sets the bytes at position
pos in the Buffer to the bytes represented by the Buffer b. |
Buffer |
setBuffer(int pos,
Buffer b,
int offset,
int len)
Sets the bytes at position
pos in the Buffer to the bytes represented by the Buffer b on the given offset and len. |
Buffer |
setByte(int pos,
byte b)
Sets the
byte at position pos in the Buffer to the value b. |
Buffer |
setBytes(int pos,
byte[] b)
Sets the bytes at position
pos in the Buffer to the bytes represented by the byte[] b. |
Buffer |
setBytes(int pos,
byte[] b,
int offset,
int len)
Sets the given number of bytes at position
pos in the Buffer to the bytes represented by the byte[] b. |
BufferImpl |
setBytes(int pos,
ByteBuffer b)
Sets the bytes at position
pos in the Buffer to the bytes represented by the ByteBuffer b. |
Buffer |
setDouble(int pos,
double d)
Sets the
double at position pos in the Buffer to the value d. |
Buffer |
setFloat(int pos,
float f)
Sets the
float at position pos in the Buffer to the value f. |
Buffer |
setInt(int pos,
int i)
Sets the
int at position pos in the Buffer to the value i. |
Buffer |
setIntLE(int pos,
int i)
Sets the
int at position pos in the Buffer to the value i in the Little Endian Byte Order. |
Buffer |
setLong(int pos,
long l)
Sets the
long at position pos in the Buffer to the value l. |
Buffer |
setLongLE(int pos,
long l)
Sets the
long at position pos in the Buffer to the value l in the Little Endian Byte Order. |
Buffer |
setMedium(int pos,
int i)
Sets the 24bit
int at position pos in the Buffer to the value i. |
Buffer |
setMediumLE(int pos,
int i)
Sets the 24bit
int at position pos in the Buffer to the value i. |
Buffer |
setShort(int pos,
short s)
Sets the
short at position pos in the Buffer to the value s. |
Buffer |
setShortLE(int pos,
short s)
Sets the
short at position pos in the Buffer to the value s in the Little Endian Byte Order. |
Buffer |
setString(int pos,
String str)
Sets the bytes at position
pos in the Buffer to the value of str encoded in UTF-8. |
Buffer |
setString(int pos,
String str,
String enc)
Sets the bytes at position
pos in the Buffer to the value of str encoded in encoding enc. |
Buffer |
setUnsignedByte(int pos,
short b)
Sets the unsigned
byte at position pos in the Buffer to the value b. |
Buffer |
setUnsignedInt(int pos,
long i)
Sets the unsigned
int at position pos in the Buffer to the value i. |
Buffer |
setUnsignedIntLE(int pos,
long i)
Sets the unsigned
int at position pos in the Buffer to the value i in the Little Endian Byte Order. |
Buffer |
setUnsignedShort(int pos,
int s)
Sets the unsigned
short at position pos in the Buffer to the value s. |
Buffer |
setUnsignedShortLE(int pos,
int s)
Sets the unsigned
short at position pos in the Buffer to the value s in the Little Endian Byte Order. |
Buffer |
slice()
Returns a slice of this buffer.
|
Buffer |
slice(int start,
int end)
Returns a slice of this buffer.
|
JsonArray |
toJsonArray()
Returns a Json array representation of the Buffer.
|
JsonObject |
toJsonObject()
Returns a Json object representation of the Buffer.
|
String |
toString()
Returns a
String representation of the Buffer with the UTF-8 encoding |
String |
toString(Charset enc)
Returns a
String representation of the Buffer with the encoding specified by enc |
String |
toString(String enc)
Returns a
String representation of the Buffer with the encoding specified by enc |
void |
writeToBuffer(Buffer buff) |
public String toString()
BufferString representation of the Buffer with the UTF-8 encodingpublic String toString(String enc)
BufferString representation of the Buffer with the encoding specified by encpublic String toString(Charset enc)
BufferString representation of the Buffer with the encoding specified by encpublic JsonObject toJsonObject()
BuffertoJsonObject in interface Bufferpublic JsonArray toJsonArray()
BuffertoJsonArray in interface Bufferpublic byte getByte(int pos)
Bufferbyte at position pos in the Buffer.public short getUnsignedByte(int pos)
Bufferbyte at position pos in the Buffer, as a short.getUnsignedByte in interface Bufferpublic int getInt(int pos)
Bufferint at position pos in the Buffer.public int getIntLE(int pos)
Bufferindex in this buffer with Little Endian Byte Order.public long getUnsignedInt(int pos)
Bufferint at position pos in the Buffer, as a long.getUnsignedInt in interface Bufferpublic long getUnsignedIntLE(int pos)
Bufferint at position pos in the Buffer, as a long in Little Endian Byte Order.getUnsignedIntLE in interface Bufferpublic long getLong(int pos)
Bufferlong at position pos in the Buffer.public long getLongLE(int pos)
Bufferindex in this buffer in Little Endian Byte Order.public double getDouble(int pos)
Bufferdouble at position pos in the Buffer.public float getFloat(int pos)
Bufferfloat at position pos in the Buffer.public short getShort(int pos)
Buffershort at position pos in the Buffer.public short getShortLE(int pos)
Bufferindex in this buffer in Little Endian Byte Order.getShortLE in interface Bufferpublic int getUnsignedShort(int pos)
Buffershort at position pos in the Buffer, as an int.getUnsignedShort in interface Bufferpublic int getUnsignedShortLE(int pos)
Bufferindex in this buffer in Little Endian Byte Order.getUnsignedShortLE in interface Bufferpublic int getMedium(int pos)
Bufferindex in this buffer.public int getMediumLE(int pos)
Bufferindex in this buffer in the Little Endian Byte Order.getMediumLE in interface Bufferpublic int getUnsignedMedium(int pos)
Bufferindex in this buffer.getUnsignedMedium in interface Bufferpublic int getUnsignedMediumLE(int pos)
Bufferindex in this buffer in Little Endian Byte Order.getUnsignedMediumLE in interface Bufferpublic byte[] getBytes()
Bufferbyte[]public byte[] getBytes(int start,
int end)
Bufferbyte[] starting at position start
and ending at position end - 1public Buffer getBytes(byte[] dst)
Bufferbyte[].public Buffer getBytes(byte[] dst, int dstIndex)
Bufferbyte[] at the specific destination.public Buffer getBytes(int start, int end, byte[] dst)
Bufferstart and ending at position end - 1
into a byte[].public Buffer getBytes(int start, int end, byte[] dst, int dstIndex)
Bufferstart and ending at position end - 1
into a byte[] at the specific destination.public Buffer getBuffer(int start, int end)
BufferBuffer starting at position start
and ending at position end - 1public String getString(int start, int end, String enc)
BufferString starting at position start
and ending at position end - 1 interpreted as a String in the specified encodingpublic String getString(int start, int end)
BufferString starting at position start
and ending at position end - 1 interpreted as a String in UTF-8 encodingpublic Buffer appendBuffer(Buffer buff)
BufferBuffer to the end of this Buffer. The buffer will expand as necessary to accommodate
any bytes written.
Returns a reference to this so multiple operations can be appended together.
appendBuffer in interface Bufferpublic Buffer appendBuffer(Buffer buff, int offset, int len)
BufferBuffer starting at the offset using len to the end of this Buffer. The buffer will expand as necessary to accommodate
any bytes written.
Returns a reference to this so multiple operations can be appended together.
appendBuffer in interface Bufferpublic Buffer appendBytes(byte[] bytes)
Bufferbyte[] to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.
Returns a reference to this so multiple operations can be appended together.
appendBytes in interface Bufferpublic Buffer appendBytes(byte[] bytes, int offset, int len)
Bufferbyte[] to the end of the Buffer, starting at the given offset.
The buffer will expand as necessary to accommodate any bytes written.
Returns a reference to this so multiple operations can be appended together.
appendBytes in interface Bufferpublic Buffer appendByte(byte b)
Bufferbyte to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.
Returns a reference to this so multiple operations can be appended together.
appendByte in interface Bufferpublic Buffer appendUnsignedByte(short b)
Bufferbyte to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.
Returns a reference to this so multiple operations can be appended together.
appendUnsignedByte in interface Bufferpublic Buffer appendInt(int i)
Bufferint to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.
Returns a reference to this so multiple operations can be appended together.
public Buffer appendIntLE(int i)
Bufferint to the end of the Buffer in the Little Endian Byte Order. The buffer will expand as necessary to accommodate any bytes written.
Returns a reference to this so multiple operations can be appended together.
appendIntLE in interface Bufferpublic Buffer appendUnsignedInt(long i)
Bufferint to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.
Returns a reference to this so multiple operations can be appended together.
appendUnsignedInt in interface Bufferpublic Buffer appendUnsignedIntLE(long i)
Bufferint to the end of the Buffer in the Little Endian Byte Order. The buffer will expand as necessary to accommodate any bytes written.
Returns a reference to this so multiple operations can be appended together.
appendUnsignedIntLE in interface Bufferpublic Buffer appendMedium(int i)
Bufferint to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.
Returns a reference to this so multiple operations can be appended together.
appendMedium in interface Bufferpublic Buffer appendMediumLE(int i)
Bufferint to the end of the Buffer in the Little Endian Byte Order. The buffer will expand as necessary to accommodate any bytes written.
Returns a reference to this so multiple operations can be appended together.
appendMediumLE in interface Bufferpublic Buffer appendLong(long l)
Bufferlong to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.
Returns a reference to this so multiple operations can be appended together.
appendLong in interface Bufferpublic Buffer appendLongLE(long l)
Bufferlong to the end of the Buffer in the Little Endian Byte Order. The buffer will expand as necessary to accommodate any bytes written.
Returns a reference to this so multiple operations can be appended together.
appendLongLE in interface Bufferpublic Buffer appendShort(short s)
Buffershort to the end of the Buffer.The buffer will expand as necessary to accommodate any bytes written.
Returns a reference to this so multiple operations can be appended together.
appendShort in interface Bufferpublic Buffer appendShortLE(short s)
Buffershort to the end of the Buffer in the Little Endian Byte Order.The buffer will expand as necessary to accommodate any bytes written.
Returns a reference to this so multiple operations can be appended together.
appendShortLE in interface Bufferpublic Buffer appendUnsignedShort(int s)
Buffershort to the end of the Buffer.The buffer will expand as necessary to accommodate any bytes written.
Returns a reference to this so multiple operations can be appended together.
appendUnsignedShort in interface Bufferpublic Buffer appendUnsignedShortLE(int s)
Buffershort to the end of the Buffer in the Little Endian Byte Order.The buffer will expand as necessary to accommodate any bytes written.
Returns a reference to this so multiple operations can be appended together.
appendUnsignedShortLE in interface Bufferpublic Buffer appendFloat(float f)
Bufferfloat to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.
Returns a reference to this so multiple operations can be appended together.
appendFloat in interface Bufferpublic Buffer appendDouble(double d)
Bufferdouble to the end of the Buffer. The buffer will expand as necessary to accommodate any bytes written.
Returns a reference to this so multiple operations can be appended together.
appendDouble in interface Bufferpublic Buffer appendString(String str, String enc)
BufferString to the end of the Buffer with the encoding as specified by enc.The buffer will expand as necessary to accommodate any bytes written.
Returns a reference to this so multiple operations can be appended together.
appendString in interface Bufferpublic Buffer appendString(String str)
BufferString str to the end of the Buffer with UTF-8 encoding.The buffer will expand as necessary to accommodate any bytes written.
Returns a reference to this so multiple operations can be appended together
appendString in interface Bufferpublic Buffer setByte(int pos, byte b)
Bufferbyte at position pos in the Buffer to the value b.The buffer will expand as necessary to accommodate any value written.
public Buffer setUnsignedByte(int pos, short b)
Bufferbyte at position pos in the Buffer to the value b.The buffer will expand as necessary to accommodate any value written.
setUnsignedByte in interface Bufferpublic Buffer setInt(int pos, int i)
Bufferint at position pos in the Buffer to the value i.The buffer will expand as necessary to accommodate any value written.
public Buffer setIntLE(int pos, int i)
Bufferint at position pos in the Buffer to the value i in the Little Endian Byte Order.The buffer will expand as necessary to accommodate any value written.
public Buffer setUnsignedInt(int pos, long i)
Bufferint at position pos in the Buffer to the value i.The buffer will expand as necessary to accommodate any value written.
setUnsignedInt in interface Bufferpublic Buffer setUnsignedIntLE(int pos, long i)
Bufferint at position pos in the Buffer to the value i in the Little Endian Byte Order.The buffer will expand as necessary to accommodate any value written.
setUnsignedIntLE in interface Bufferpublic Buffer setMedium(int pos, int i)
Bufferint at position pos in the Buffer to the value i.The buffer will expand as necessary to accommodate any value written.
public Buffer setMediumLE(int pos, int i)
Bufferint at position pos in the Buffer to the value i. in the Little Endian Byte OrderThe buffer will expand as necessary to accommodate any value written.
setMediumLE in interface Bufferpublic Buffer setLong(int pos, long l)
Bufferlong at position pos in the Buffer to the value l.The buffer will expand as necessary to accommodate any value written.
public Buffer setLongLE(int pos, long l)
Bufferlong at position pos in the Buffer to the value l in the Little Endian Byte Order.The buffer will expand as necessary to accommodate any value written.
public Buffer setDouble(int pos, double d)
Bufferdouble at position pos in the Buffer to the value d.The buffer will expand as necessary to accommodate any value written.
public Buffer setFloat(int pos, float f)
Bufferfloat at position pos in the Buffer to the value f.The buffer will expand as necessary to accommodate any value written.
public Buffer setShort(int pos, short s)
Buffershort at position pos in the Buffer to the value s.The buffer will expand as necessary to accommodate any value written.
public Buffer setShortLE(int pos, short s)
Buffershort at position pos in the Buffer to the value s in the Little Endian Byte Order.The buffer will expand as necessary to accommodate any value written.
setShortLE in interface Bufferpublic Buffer setUnsignedShort(int pos, int s)
Buffershort at position pos in the Buffer to the value s.The buffer will expand as necessary to accommodate any value written.
setUnsignedShort in interface Bufferpublic Buffer setUnsignedShortLE(int pos, int s)
Buffershort at position pos in the Buffer to the value s in the Little Endian Byte Order.The buffer will expand as necessary to accommodate any value written.
setUnsignedShortLE in interface Bufferpublic Buffer setBuffer(int pos, Buffer b)
Bufferpos in the Buffer to the bytes represented by the Buffer b.The buffer will expand as necessary to accommodate any value written.
public Buffer setBuffer(int pos, Buffer b, int offset, int len)
Bufferpos in the Buffer to the bytes represented by the Buffer b on the given offset and len.The buffer will expand as necessary to accommodate any value written.
public BufferImpl setBytes(int pos, ByteBuffer b)
Bufferpos in the Buffer to the bytes represented by the ByteBuffer b.The buffer will expand as necessary to accommodate any value written.
public Buffer setBytes(int pos, byte[] b)
Bufferpos in the Buffer to the bytes represented by the byte[] b.The buffer will expand as necessary to accommodate any value written.
public Buffer setBytes(int pos, byte[] b, int offset, int len)
Bufferpos in the Buffer to the bytes represented by the byte[] b.
The buffer will expand as necessary to accommodate any value written.public Buffer setString(int pos, String str)
Bufferpos in the Buffer to the value of str encoded in UTF-8.The buffer will expand as necessary to accommodate any value written.
public Buffer setString(int pos, String str, String enc)
Bufferpos in the Buffer to the value of str encoded in encoding enc.The buffer will expand as necessary to accommodate any value written.
public int length()
Bufferpublic Buffer copy()
Bufferpublic Buffer slice()
Bufferpublic Buffer slice(int start, int end)
Bufferpublic io.netty.buffer.ByteBuf getByteBuf()
BufferByteBuf.The returned buffer is a duplicate.
The returned ByteBuf might have its readerIndex > 0
This method is meant for internal use only.
getByteBuf in interface Bufferpublic void writeToBuffer(Buffer buff)
writeToBuffer in interface ClusterSerializablepublic int readFromBuffer(int pos,
Buffer buffer)
readFromBuffer in interface ClusterSerializableCopyright © 2020. All rights reserved.