W3cubDocs

/Dart 2

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

isEmptybool
read-only
Returns true if the buffer is empty.
isNotEmptybool
read-only
Returns true if the buffer is not empty.
lengthint
read-only
The number of bytes in the builder.
hashCodeint
read-only, inherited
The hash code for this object. [...]
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 the builder. [...]
addByte(int byte) → void
Append byte to the current contents of the builder. [...]
clear() → void
Clear the contents of the builder.
takeBytes() → Uint8List
Returns the contents of this and clears this. [...]
toBytes() → Uint8List
Returns a copy of the current contents of the builder. [...]
noSuchMethod(Invocation invocation) → dynamic
inherited
Invoked when a non-existent method or property is accessed. [...]
toString() → String
inherited
Returns a string representation of this object.

Operators

operator ==(dynamic 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.5.0/dart-io/BytesBuilder-class.html