Google.Protobuf.WritingPrimitives
Primitives for encoding protobuf wire format.
Encode a 32-bit value with ZigZag encoding.
Encode a 64-bit value with ZigZag encoding.
Writes a bool field value, without a tag, to the stream.
Write a byte string, without a tag, to the stream.
The data is length-prefixed.
Writes a double field value, without a tag, to the stream.
Writes an enum value, without a tag, to the stream.
Writes a fixed32 field value, without a tag, to the stream.
Writes a fixed64 field value, without a tag, to the stream.
Writes a float field value, without a tag, to the stream.
Writes an int32 field value, without a tag, to the stream.
Writes an int64 field value, without a tag, to the stream.
Writes a length (in bytes) for length-delimited data.
Writes out an array of bytes.
public static void WriteRawBytes(ref Span buffer, ref WriterInternalState state, byte[] value, int offset, int length)
Writes out part of an array of bytes.
public static void WriteRawBytes(ref Span buffer, ref WriterInternalState state, ReadOnlySpan<byte> value)
Writes out part of an array of bytes.
public static void WriteRawLittleEndian32(ref Span buffer, ref WriterInternalState state, uint value)
public static void WriteRawLittleEndian64(ref Span buffer, ref WriterInternalState state, ulong value)
public static void WriteRawLittleEndian64SlowPath(ref Span buffer, ref WriterInternalState state, ulong value)
Writes the given single-byte tag directly to the stream.
Writes the given two-byte tag directly to the stream.
public static void WriteRawTag(ref Span buffer, ref WriterInternalState state, byte b1, byte b2, byte b3)
Writes the given three-byte tag directly to the stream.
public static void WriteRawTag(ref Span buffer, ref WriterInternalState state, byte b1, byte b2, byte b3, byte b4)
Writes the given four-byte tag directly to the stream.
public static void WriteRawTag(ref Span buffer, ref WriterInternalState state, byte b1, byte b2, byte b3, byte b4, byte b5)
Writes the given five-byte tag directly to the stream.
Writes a 32 bit value as a varint. The fast route is taken when
there's enough buffer space left to whizz through without checking
for each byte; otherwise, we resort to calling WriteRawByte each time.
Writes an sfixed32 value, without a tag, to the stream.
Writes an sfixed64 value, without a tag, to the stream.
Writes an sint32 value, without a tag, to the stream.
Writes an sint64 value, without a tag, to the stream.
Writes a string field value, without a tag, to the stream.
The data is length-prefixed.
public static void WriteTag(ref Span buffer, ref WriterInternalState state, int fieldNumber, WireType type)
Encodes and writes a tag.
Writes an already-encoded tag.
Writes a uint32 value, without a tag, to the stream.
Writes a uint64 field value, without a tag, to the stream.