Appends the specified Buffer
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.
Appends the specified Buffer
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.
Appends the specified byte
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.
Appends the specified byte[]
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.
Appends the specified number of bytes from byte[]
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.
Appends the specified double
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.
Appends the specified float
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.
Appends the specified int
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.
Appends the specified int
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.
Appends the specified long
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.
Appends the specified long
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.
Appends the specified 24bit int
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.
Appends the specified 24bit int
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.
Appends the specified short
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.
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.
Returns a reference to this
so multiple operations can be appended together.
Appends the specified String
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.
Appends the specified String 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
Appends the specified unsigned byte
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.
Appends the specified unsigned int
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.
Appends the specified unsigned int
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.
Appends the specified unsigned short
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.
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.
Returns a reference to this
so multiple operations can be appended together.
Returns a copy of the entire Buffer.
Returns the byte
at position pos
in the Buffer.
Returns the Buffer as a Netty ByteBuf
.
The returned buffer is a duplicate that maintain its own indices.
Returns a copy of the entire Buffer as a byte[]
Returns a copy of a sub-sequence the Buffer as a byte[]
starting at position start
and ending at position end - 1
Transfers the content of the Buffer into a byte[]
.
Transfers the content of the Buffer into a byte[]
at the specific destination.
Transfers the content of the Buffer starting at position start
and ending at position end - 1
into a byte[]
.
Transfers the content of the Buffer starting at position start
and ending at position end - 1
into a byte[]
at the specific destination.
Returns the double
at position pos
in the Buffer.
Returns the float
at position pos
in the Buffer.
Returns the int
at position pos
in the Buffer.
Gets a 32-bit integer at the specified absolute index
in this buffer with Little Endian Byte Order.
Returns the long
at position pos
in the Buffer.
Gets a 64-bit long integer at the specified absolute index
in this buffer in Little Endian Byte Order.
Gets a 24-bit medium integer at the specified absolute index
in this buffer.
Gets a 24-bit medium integer at the specified absolute index
in this buffer in the Little Endian Byte Order.
Returns the short
at position pos
in the Buffer.
Gets a 16-bit short integer at the specified absolute index
in this buffer in Little Endian Byte Order.
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
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
Returns the unsigned byte
at position pos
in the Buffer, as a short
.
Returns the unsigned int
at position pos
in the Buffer, as a long
.
Returns the unsigned int
at position pos
in the Buffer, as a long
in Little Endian Byte Order.
Gets an unsigned 24-bit medium integer at the specified absolute index
in this buffer.
Gets an unsigned 24-bit medium integer at the specified absolute index
in this buffer in Little Endian Byte Order.
Returns the unsigned short
at position pos
in the Buffer, as an int
.
Gets an unsigned 16-bit short integer at the specified absolute index
in this buffer in Little Endian Byte Order.
Returns the length of the buffer, measured in bytes. All positions are indexed from zero.
Sets the bytes at position pos
in the Buffer to the bytes represented by the Buffer b
.
The buffer will expand as necessary to accommodate any value written.
Sets the bytes at position pos
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.
Sets the byte
at position pos
in the Buffer to the value b
.
The buffer will expand as necessary to accommodate any value written.
Sets the bytes at position pos
in the Buffer to the bytes represented by the ByteBuffer b
.
The buffer will expand as necessary to accommodate any value written.
Sets the bytes at position pos
in the Buffer to the bytes represented by the byte[] b
.
The buffer will expand as necessary to accommodate any value written.
Sets the given number of bytes at position pos
in the Buffer to the bytes represented by the byte[] b
.
Sets the double
at position pos
in the Buffer to the value d
.
The buffer will expand as necessary to accommodate any value written.
Sets the float
at position pos
in the Buffer to the value f
.
The buffer will expand as necessary to accommodate any value written.
Sets the int
at position pos
in the Buffer to the value i
.
The buffer will expand as necessary to accommodate any value written.
Sets the int
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.
Sets the long
at position pos
in the Buffer to the value l
.
The buffer will expand as necessary to accommodate any value written.
Sets the long
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.
Sets the 24bit int
at position pos
in the Buffer to the value i
.
The buffer will expand as necessary to accommodate any value written.
Sets the 24bit int
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.
Sets the short
at position pos
in the Buffer to the value s
.
The buffer will expand as necessary to accommodate any value written.
Sets the short
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.
Sets the bytes at position pos
in the Buffer to the value of str
encoded in UTF-8.
The buffer will expand as necessary to accommodate any value written.
Sets the bytes at position pos
in the Buffer to the value of str
encoded in encoding enc
.
The buffer will expand as necessary to accommodate any value written.
Sets the unsigned byte
at position pos
in the Buffer to the value b
.
The buffer will expand as necessary to accommodate any value written.
Sets the unsigned int
at position pos
in the Buffer to the value i
.
The buffer will expand as necessary to accommodate any value written.
Sets the unsigned int
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.
Sets the unsigned short
at position pos
in the Buffer to the value s
.
The buffer will expand as necessary to accommodate any value written.
Sets the unsigned short
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.
Returns a slice of this buffer. Modifying the content of the returned buffer or this buffer affects each other's content while they maintain separate indexes and marks.
Returns a slice of this buffer. Modifying the content of the returned buffer or this buffer affects each other's content while they maintain separate indexes and marks.
Returns a Json representation of the Buffer.
Returns a Json array representation of the Buffer.
Returns a Json object representation of the Buffer.
Returns a String
representation of the Buffer with the UTF-8
encoding
Returns a String
representation of the Buffer with the encoding specified by enc
Returns a String
representation of the Buffer with the encoding specified by enc
Create a new, empty buffer.
Create a new buffer given the initial size hint.
If you know the buffer will require a certain size, providing the hint can prevent unnecessary re-allocations as the buffer is written to and resized.
Create a new buffer from a string. The string will be UTF-8 encoded into the buffer.
Create a new buffer from a string and using the specified encoding. The string will be encoded into the buffer using the specified encoding.
Create a new buffer from a byte[]. The byte[] will be copied to form the buffer.
Create a new buffer from a Netty ByteBuf
.
Note that the returned buffer is backed by given Netty ByteBuf,
so changes in the returned buffer are reflected in given Netty ByteBuf, and vice-versa.
For example, both buffers in the code below share their data:
Buffer src = Buffer.buffer(); Buffer clone = Buffer.buffer(src.getByteBuf());
Generated using TypeDoc
Most data is shuffled around inside Vert.x using buffers.
A buffer is a sequence of zero or more bytes that can read from or written to and which expands automatically as necessary to accommodate any bytes written to it. You can perhaps think of a buffer as smart byte array.
Please consult the documentation for more information on buffers.