CodedBufferWriter class

Writer used for converting GeneratedMessages into binary representation.

Note that it is impossible to serialize protobuf messages using a one pass streaming serialization as some values are serialized using length-delimited representation, which means that they are represented as a varint encoded length followed by specified number of bytes of data.

Due to this CodedBufferWriter maintains two output buffers: _outputChunks which contains all continuously written bytes and _splices which describes additional bytes to splice in-between _outputChunks bytes.

Constructors

CodedBufferWriter()

Properties

hashCode int
The hash code for this object.
no setterinherited
lengthInBytes int
no setter
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
toBuffer() Uint8List
toString() String
A string representation of this object.
inherited
writeField(int fieldNumber, int fieldType, Object? fieldValue) → void
writeInt32NoTag(int value) → void
writeRawBytes(TypedData value) → void
Add TypedData splice - these bytes would be directly copied into the output buffer by writeTo.
writeTo(Uint8List buffer, [int offset = 0]) bool
Serializes everything written to this writer so far to buffer, starting from offset in buffer. Returns true on success.

Operators

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