RawWriter class
Writes values into a buffer.
If isExpanding is true, buffer is automatically is expanded.
Constructors
- RawWriter.withByteData(ByteData _byteData, {bool isExpanding = true})
- Constructor that uses the ByteData as buffer.
- RawWriter.withCapacity(int capacity, {bool isExpanding = true})
-
Constructor that allocates a new buffer with the capacity.
factory
- RawWriter.withUint8List(Uint8List list, {bool isExpanding = true})
- Constructor that uses the Uint8List as buffer.
Properties
- bufferAsByteData → ByteData
-
Returns the buffer.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isExpanding → bool
-
Determines whether buffer is expanded automatically.
final
- length ↔ int
-
Current written length.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
ensureAvailableLength(
int length) → void - Ensures that the buffer has space for N more bytes.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toByteDataCopy(
) → ByteData - Returns a copy of the written bytes. The length will be equal to length.
-
toByteDataView(
) → ByteData - Returns a view at the written bytes. The length will be equal to length.
-
toString(
) → String -
A string representation of this object.
inherited
-
toUint8ListCopy(
) → Uint8List - Returns a copy of the written bytes. The length will be equal to length.
-
toUint8ListView(
) → Uint8List - Returns a view at the written bytes. The length will be equal to length.
-
writeByteData(
ByteData value, [int index = 0, int? writtenLength]) → void - Writes bytes from ByteData.
-
writeBytes(
List< int> value, [int index = 0, int? writtenLength]) → void - Writes bytes from a list.
-
writeFixInt64(
Int64 value, [Endian endian = Endian.big]) → void - Writes 64-bit integer (Int64 from 'package:fixnum').
-
writeFloat32(
double value, [Endian endian = Endian.big]) → void - Writes a 32-bit floating-point value.
-
writeFloat64(
double value, [Endian endian = Endian.big]) → void - Writes a 64-bit floating-point value.
-
writeInt16(
int value, [Endian endian = Endian.big]) → void - Writes an 16-bit signed integer.
-
writeInt32(
int value, [Endian endian = Endian.big]) → void - Writes a 32-bit signed integer.
-
writeInt8(
int value) → void - Writes an 8-bit signed integer.
-
writeSelfEncoder(
SelfEncoder encoder) → void - Writes a SelfEncoder.
-
writeUint16(
int value, [Endian endian = Endian.big]) → void - Writes a 16-bit unsigned integer.
-
writeUint32(
int value, [Endian endian = Endian.big]) → void - Writes a 32-bit unsigned integer.
-
writeUint8(
int value) → void - Writes an 8-bit unsigned integer.
-
writeUtf8(
String value, {int? maxLengthInBytes}) → int - Writes an UTF-8 string. Returns number of written bytes.
-
writeUtf8NullEnding(
String value, {int? maxLengthInBytes}) → int - Writes an UTF-8 string. Returns number of written bytes, including the final null-character.
-
writeUtf8Simple(
String value) → void - Writes an UTF-8 string.
-
writeUtf8SimpleNullEnding(
String value) → void - Writes a null-delimited UTF-8 string. Validates that all runes take only a single byte in UTF-8.
-
writeVarInt(
int value) → void - Writes variable-length signed integer.
-
writeVarUint(
int value) → void - Writes variable-length unsigned integer.
-
writeZeroes(
int writtenLength) → void - Writes N zeroes.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited