dart:typed_data
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
- hashCode → int
read-only, inherited
- The hash code for this object.
- isEmpty → bool
read-only
- Whether the buffer is empty.
- isNotEmpty → bool
read-only
- Whether the buffer is non-empty.
- length → int
read-only
- The number of bytes in this builder.
- runtimeType → Type
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.