BytesBuilder class

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})
factory
Construct a new empty BytesBuilder. [...]

Properties

hashCodeint
read-only, inherited
The hash code for this object. [...]
isEmptybool
read-only
Whether the buffer is empty.
isNotEmptybool
read-only
Whether the buffer is non-empty.
lengthint
read-only
The number of bytes in this builder.
runtimeTypeType
read-only, inherited
A representation of the runtime type of the object.

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
inherited
Invoked when a non-existent method or property is accessed. [...]
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
inherited
A string representation of this object. [...]

Operators

operator ==(Object other) → bool
inherited
The equality operator. [...]

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.13.0/dart-typed_data/BytesBuilder-class.html