The number of bytes in the buffer
Returns a new buffer representing a slice of this buffer, delimited
by the indices i
inclusive and j
exclusive: [i, j)
.
Returns a new buffer representing a slice of this buffer, delimited
by the indices i
inclusive and j
exclusive: [i, j)
. Out of bounds
indices are truncated. Negative indices are not accepted.
Write the entire contents of the buffer into the given array at the given offset.
Write the entire contents of the buffer into the given array at the given offset. Partial writes aren't supported directly through this API; they easily performed by first slicing the buffer.
Concatenate this buffer with the given buffer.
Buf represents a fixed, immutable byte buffer. Buffers may be sliced and concatenated, and thus be used to implement bytestreams.