<PackageReference Include="Google.Protobuf" Version="3.35.0" />

Google.Protobuf.CodedInputStream

public sealed class CodedInputStream : IDisposable
Reads and decodes protocol message fields.
public bool IsAtEnd { get; }

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.

public long Position { get; }

Returns the current position in the input stream, or the position in the input buffer

public int RecursionLimit { get; }

Returns the recursion limit for this stream. This limit is applied whilst reading messages, to avoid maliciously-recursive data.

public int SizeLimit { get; }

Returns the size limit for this stream.

public CodedInputStream(byte[] buffer)

Creates a new CodedInputStream reading data from the given byte array.

public CodedInputStream(byte[] buffer, int offset, int length)

Creates a new CodedInputStream that reads from the given byte array slice.

public CodedInputStream(Stream input)

Creates a new CodedInputStream reading data from the given stream, which will be disposed when the returned object is disposed.

public CodedInputStream(Stream input, bool leaveOpen)

Creates a new CodedInputStream reading data from the given stream.

public static CodedInputStream CreateWithLimits(Stream input, int sizeLimit, int recursionLimit)

Creates a CodedInputStream with the specified size and recursion limits, reading from an input stream.

public void Dispose()

Disposes of this instance, potentially closing any underlying stream.

public bool MaybeConsumeTag(uint tag)

Peeks at the next tag in the stream. If it matches tag, the tag is consumed and the method returns true; otherwise, the stream is left in the original position and the method returns false.

public uint PeekTag()

Peeks at the next field tag. This is like calling ReadTag, but the tag is not consumed. (So a subsequent call to ReadTag will return the same value.)

public bool ReadBool()

Reads a bool field from the stream.

Reads a bytes field value from the stream.

public double ReadDouble()

Reads a double field from the stream.

public int ReadEnum()

Reads an enum field value from the stream.

public uint ReadFixed32()

Reads a fixed32 field from the stream.

public ulong ReadFixed64()

Reads a fixed64 field from the stream.

public float ReadFloat()

Reads a float field from the stream.

public void ReadGroup(IMessage builder)

Reads an embedded group field from the stream.

public int ReadInt32()

Reads an int32 field from the stream.

public long ReadInt64()

Reads an int64 field from the stream.

public int ReadLength()

Reads a length for length-delimited data.

public void ReadMessage(IMessage builder)

Reads an embedded message field value from the stream.

public void ReadRawMessage(IMessage message)

Reads a top-level message or a nested message after the limits for this message have been pushed. (parser will proceed until the end of the current limit) NOTE: this method needs to be public because it's invoked by the generated code - e.g. msg.MergeFrom(CodedInputStream input) method

public int ReadSFixed32()

Reads an sfixed32 field value from the stream.

public long ReadSFixed64()

Reads an sfixed64 field value from the stream.

public int ReadSInt32()

Reads an sint32 field value from the stream.

public long ReadSInt64()

Reads an sint64 field value from the stream.

public string ReadString()

Reads a string field from the stream.

public uint ReadTag()

Reads a field tag, returning the tag of 0 for "end of stream".

public uint ReadUInt32()

Reads a uint32 field value from the stream.

public ulong ReadUInt64()

Reads a uint64 field from the stream.

public void SkipLastField()

Skips the data for the field with the tag we've just read. This should be called directly after ReadTag, when the caller wishes to skip an unknown field.