BufferWriter class

Buffer Writer

Constructors

BufferWriter(int length, {bool growable = false})
Creates a zero initialised buffer of size length that maintains its offset position while writing data to the buffer.
BufferWriter.mutable([int length = defaultMutableLength])
Creates a resizable BufferWriter with an initial length.
factory

Properties

buffer Buffer
The buffer to write to.
getter/setter pair
growable bool
If true, dynamically increase the size of the buffer as needed.
final
hashCode int
The hash code for this object.
no setterinherited
length int
The capacity.
no setter
offset int
The current offset.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setBigInt(BigInt value, int length) → void
Writes a big signed integer to a region of the buffer.
setBigUint(BigInt value, int length) → void
Writes a big unsigned integer to a region of the buffer.
setBool(bool value) → void
Writes a boolean value to 1-byte.
setBuffer(Iterable<int> value) → void
Writes a byte array to a region of buffer starting at offset. The internal offset is advanced by value length.
setDateTime(DateTime value) → void
Writes a DateTime to the buffer as an i64.
setFloat32(double value) → void
Writes a floating point value to 4-bytes.
setFloat64(double value) → void
Writes a double precision floating point value to 8-bytes.
setInt(int value, int length) → void
Writes a signed integer to a region of the buffer.
setInt128(BigInt value) → void
Writes a signed integer to 16-bytes.
setInt16(int value) → void
Writes a signed integer to 2-bytes.
setInt32(int value) → void
Writes a signed integer to 4-bytes.
setInt64(int value) → void
Writes a signed integer to 8-bytes.
setInt8(int value) → void
Writes a signed integer to 1-byte.
setString(String value, [BufferEncoding encoding = BufferEncoding.utf8]) → void
Writes an `encoded value to a region of the buffer.
setUint(int value, int length) → void
Writes an unsigned integer to a region of the buffer.
setUint128(BigInt value) → void
Writes an unsigned integer to 16-bytes.
setUint16(int value) → void
Writes an unsigned integer to 2-bytes.
setUint32(int value) → void
Writes an unsigned integer to 4-bytes.
setUint64(BigInt value) → void
Writes an unsigned integer to 8-bytes.
setUint8(int value) → void
Writes an unsigned integer to 1-byte.
toBuffer({required bool slice}) Buffer
Creates a new Buffer from a region of this buffer.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

defaultMutableLength → const int
The default length of a mutable buffer.