class
BytesBuilder

Builds a list of bytes, allowing bytes and lists of bytes to be added at the end.

Used to efficiently collect bytes and lists of bytes.

Properties

int length
read-only
The number of bytes in the builder.
bool isEmpty
read-only
Returns true if the buffer is empty.
bool isNotEmpty
read-only
Returns true if the buffer is not empty.

Constructors

BytesBuilder({bool copy: true})
Construct a new empty BytesBuilder.

Methods

add(List<int> bytes) → void
Appends bytes to the current contents of the builder.
addByte(int byte) → void
Append byte to the current contents of the builder.
takeBytes() → List<int>
Returns the contents of this and clears this.
toBytes() → List<int>
Returns a copy of the current contents of the builder.
clear() → void
Clear the contents of the builder.