This class is generally used by generated code to write appropriate primitives to the stream. It effectively encapsulates the lowest levels of protocol buffer format. Unlike some other implementations, this does not include combined "write tag and value" methods. Generated code knows the exact byte representations of the tags they're going to write, so there's no need to re-encode them each time. Manually-written code calling this class should just call one of the WriteTag
overloads before each value.
Repeated fields and map fields are not handled by this class; use RepeatedField<T>
and MapField<TKey, TValue>
to serialize such fields.