Optional textEncoder: TextEncoderLikeProtected bufPrivate chunksWe cannot allocate a buffer for the entire output because we don't know it's size.
So we collect smaller chunks of known size and concat them later.
Use raw() to push data to this array. It will flush
buf first.
Private stackPrevious fork states.
Private Readonly textText encoder instance to convert UTF-8 to bytes.
Write a bool value, a variant.
Write a bytes value, length-delimited arbitrary data.
Write a double value, a 64-bit floating point number.
Write a fixed32 value, an unsigned, fixed-length 32-bit integer.
Write a fixed64 value, an unsigned, fixed-length 64 bit integer.
Write a float value, 32-bit floating point number.
Start a new fork for length-delimited data like a message or a packed repeated field.
Must be joined later with join().
Write a int32 value, a signed 32 bit varint.
Write a int64 value, a signed 64-bit varint.
Join the last fork. Write its length and bytes, then return to the previous state.
Write a chunk of raw bytes.
Write a sfixed32 value, a signed, fixed-length 32-bit integer.
Write a fixed64 value, a signed, fixed-length 64-bit integer.
Write a sint32 value, a signed, zigzag-encoded 32-bit varint.
Write a sint64 value, a signed, zig-zag-encoded 64-bit varint.
Write a string value, length-delimited data converted to UTF-8 text.
Writes a tag (field number and wire type).
Equivalent to uint32( (fieldNo << 3 | type) >>> 0 ).
Generated code should compute the tag ahead of time and call uint32().
Write a uint32 value, an unsigned 32 bit varint.
Write a uint64 value, an unsigned 64-bit varint.
A growing buffer for byte values. If you don't know the size of the data you are writing, push to this array.