BufferWriter class
Buffer Writer
Constructors
- BufferWriter(int length, {bool growable = false})
-
Creates a
zero initialisedbuffer of sizelengththat 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 integerto a region of the buffer. -
setBigUint(
BigInt value, int length) → void -
Writes a
big unsigned integerto a region of the buffer. -
setBool(
bool value) → void -
Writes a
booleanvalue to1-byte. -
setBuffer(
Iterable< int> value) → void -
Writes a byte array to a region of buffer starting at offset. The internal offset is
advanced by
valuelength. -
setDateTime(
DateTime value) → void -
Writes a DateTime to the buffer as an
i64. -
setFloat32(
double value) → void -
Writes a
floating pointvalueto4-bytes. -
setFloat64(
double value) → void -
Writes a
double precision floating pointvalueto8-bytes. -
setInt(
int value, int length) → void -
Writes a
signed integerto a region of the buffer. -
setInt128(
BigInt value) → void -
Writes a
signed integerto16-bytes. -
setInt16(
int value) → void -
Writes a
signed integerto2-bytes. -
setInt32(
int value) → void -
Writes a
signed integerto4-bytes. -
setInt64(
int value) → void -
Writes a
signed integerto8-bytes. -
setInt8(
int value) → void -
Writes a
signed integerto1-byte. -
setString(
String value, [BufferEncoding encoding = BufferEncoding.utf8]) → void -
Writes an `encoded
valueto a region of the buffer. -
setUint(
int value, int length) → void -
Writes an
unsigned integerto a region of the buffer. -
setUint128(
BigInt value) → void -
Writes an
unsigned integerto16-bytes. -
setUint16(
int value) → void -
Writes an
unsigned integerto2-bytes. -
setUint32(
int value) → void -
Writes an
unsigned integerto4-bytes. -
setUint64(
BigInt value) → void -
Writes an
unsigned integerto8-bytes. -
setUint8(
int value) → void -
Writes an
unsigned integerto1-byte. -
toBuffer(
{required bool slice}) → Buffer -
Creates a new Buffer from a region of
thisbuffer. -
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.