Google.Protobuf.SegmentedBufferHelper
struct SegmentedBufferHelper
Abstraction for reading from a stream / read only sequence.
Parsing from the buffer is a loop of reading from current buffer / refreshing the buffer once done.
public static void Initialize(CodedInputStream codedInputStream, out SegmentedBufferHelper instance)
Initialize an instance with a coded input stream.
This approach is faster than using a constructor because the instance to initialize is passed by reference
and we can write directly into it without copying.
public static void Initialize(ReadOnlySequence<byte> sequence, out SegmentedBufferHelper instance, out ReadOnlySpan firstSpan)
Initialize an instance with a read only sequence.
This approach is faster than using a constructor because the instance to initialize is passed by reference
and we can write directly into it without copying.
Returns true if the stream has reached the end of the input. This is the
case if either the end of the underlying input source has been reached or
the stream has reached a limit created using PushLimit.
Returns whether or not all the data before the limit has been read.
Discards the current limit, returning the previous limit.
Sets currentLimit to (current position) + byteLimit. This is called
when descending into a length-delimited embedded message. The previous
limit is returned.