A buffer representing an array of bytes.
A buffer representing the remaining bytes in the given ByteBuffer.
A buffer representing the remaining bytes in the given ByteBuffer. The given buffer will not be affected.
Modifications to the ByteBuffer's content will be visible to the resulting Buf. The ByteBuffer should be immutable in practice.
a StringCoder for a given java.nio.charset.Charset provides an encoder: String -> Buf and an extractor: Buf -> Option[String].
a StringCoder for a given java.nio.charset.Charset provides an encoder: String -> Buf and an extractor: Buf -> Option[String].
Malformed and unmappable input is silently replaced see java.nio.charset.CodingErrorAction.REPLACE
An empty buffer.
Create and deconstruct buffers encoded by the ISO Latin Alphabet No.
Create and deconstruct buffers encoded by the ISO Latin Alphabet No. 1 charset.
Malformed and unmappable input is silently replaced see java.nio.charset.CodingErrorAction.REPLACE
Create and deconstruct unsigned 32-bit big endian encoded buffers.
Create and deconstruct unsigned 32-bit big endian encoded buffers.
Deconstructing will return the value as well as the remaining buffer.
Create and deconstruct unsigned 32-bit little endian encoded buffers.
Create and deconstruct unsigned 32-bit little endian encoded buffers.
Deconstructing will return the value as well as the remaining buffer.
Create and deconstruct unsigned 64-bit big endian encoded buffers.
Create and deconstruct unsigned 64-bit big endian encoded buffers.
Deconstructing will return the value as well as the remaining buffer.
Create and deconstruct unsigned 64-bit little endian encoded buffers.
Create and deconstruct unsigned 64-bit little endian encoded buffers.
Deconstructing will return the value as well as the remaining buffer.
Create and deconstruct buffers encoded by the 7-bit ASCII, also known as ISO646-US or the Basic Latin block of the Unicode character set.
Create and deconstruct buffers encoded by the 7-bit ASCII, also known as ISO646-US or the Basic Latin block of the Unicode character set.
Malformed and unmappable input is silently replaced see java.nio.charset.CodingErrorAction.REPLACE
Create and deconstruct 16-bit UTF buffers.
Create and deconstruct 16-bit UTF buffers.
Malformed and unmappable input is silently replaced see java.nio.charset.CodingErrorAction.REPLACE
Create and deconstruct buffers encoded by the 16-bit UTF charset with big-endian byte order.
Create and deconstruct buffers encoded by the 16-bit UTF charset with big-endian byte order.
Malformed and unmappable input is silently replaced see java.nio.charset.CodingErrorAction.REPLACE
Create and deconstruct buffers encoded by the 16-bit UTF charset with little-endian byte order.
Create and deconstruct buffers encoded by the 16-bit UTF charset with little-endian byte order.
Malformed and unmappable input is silently replaced see java.nio.charset.CodingErrorAction.REPLACE
Create and deconstruct Utf-8 encoded buffers.
Create and deconstruct Utf-8 encoded buffers.
Malformed and unmappable input is silently replaced see java.nio.charset.CodingErrorAction.REPLACE
Byte equality between two buffers.
Byte equality between two buffers. May copy.
Relies on Buf.ByteArray.equals.
The 32-bit FNV-1 of Buf
Return a string representing the buffer contents in hexadecimal.
Buf wrapper-types (like Buf.ByteArray and Buf.ByteBuffer) provide Shared and Owned APIs, each of which with construction & extraction utilities.
The Owned APIs may provide direct access to a Buf's underlying implementation; and so mutating the data structure invalidates a Buf's immutability constraint. Users must take care to handle this data immutably.
The Shared variants, on the other hand, ensure that the Buf shares no state with the caller (at the cost of additional allocation).
Note: There is a Java-friendly API for this object: com.twitter.io.Buf.