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.

Constructors

BytesBuilder({bool copy: true})

Construct a new empty BytesBuilder.

factory

Properties

hashCode int

Get a hash code for this object.

read-only, inherited
isEmpty bool

Returns true if the buffer is empty.

read-only
isNotEmpty bool

Returns true if the buffer is not empty.

read-only
length int

The number of bytes in the builder.

read-only
runtimeType Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator ==(other) bool

The equality operator.

inherited

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.

clear() → void

Clear the contents of the builder.

noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
takeBytes() List<int>

Returns the contents of this and clears this.

toBytes() List<int>

Returns a copy of the current contents of the builder.

toString() String

Returns a string representation of this object.

inherited