BytesBuilder class - dart:typed_data library (original) (raw)

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

hashCodeint

The hash code for this object.

no setterinherited

isEmptybool

Whether the buffer is empty.

no setter

isNotEmptybool

Whether the buffer is non-empty.

no setter

lengthint

The number of bytes in this builder.

no setter

runtimeTypeType

A representation of the runtime type of the object.

no setterinherited

Methods

add(List<int> bytes)→ void

Appends bytes to the current contents of this builder.

addByte(int byte)→ void

Appends byte to the current contents of this builder.

clear()→ void

Clears the contents of this builder.

noSuchMethod(Invocation invocation)→ dynamic

Invoked when a nonexistent method or property is accessed.

inherited

takeBytes()→ Uint8List

Returns the bytes currently contained in this builder and clears it.

toBytes()→ Uint8List

Returns a copy of the current byte contents of this builder.

toString()→ String

A string representation of this object.

inherited

Operators

operator ==(Object other)→ bool

The equality operator.

inherited