Redigera

Dela via


Reader<TInput> Struct

Definition

Provides functionality for parsing data from binary input.

public ref struct Reader<TInput>
type Reader<'Input> = struct
Public Structure Reader(Of TInput)

Type Parameters

TInput

The underlying buffer reader type.

Inheritance
Reader<TInput>

Properties

Length

Gets the input length.

Position

Gets the current reader position.

Session

Gets the serializer session.

Methods

ForkFrom(Int64, Reader<TInput>)

Creates a new reader beginning at the specified position.

ReadByte()

Reads a byte from the input.

ReadBytes(Span<Byte>)

Fills destination with bytes read from the input.

ReadBytes(UInt32)

Reads an array of bytes from the input.

ReadBytes<TBufferWriter>(TBufferWriter, Int32)

Reads the specified number of bytes into the provided writer.

ReadInt32()

Reads an Int32 from the input.

ReadInt64()

Reads a Int64 from the input.

ReadUInt32()

Reads a UInt32 from the input.

ReadUInt64()

Reads a UInt64 from the input.

ReadVarUInt32()

Reads a variable-width UInt32 from the input.

ReadVarUInt64()

Reads a variable-width UInt64 from the input.

ResumeFrom(Int64)

Resumes the reader from the specified position after forked readers are no longer in use.

Skip(Int64)

Skips the specified number of bytes.

TryReadBytes(Int32, ReadOnlySpan<Byte>)

Tries the read the specified number of bytes from the input.

Extension Methods

ReadInt16<TInput>(Reader<TInput>, WireType)

Reads a variable-width Int16.

ReadInt32<TInput>(Reader<TInput>, WireType)

Reads a variable-width Int32.

ReadInt64<TInput>(Reader<TInput>, WireType)

Reads a variable-width Int64.

ReadInt8<TInput>(Reader<TInput>, WireType)

Reads a variable-width SByte.

ReadUInt16<TInput>(Reader<TInput>, WireType)

Reads a variable-width UInt16.

ReadUInt32<TInput>(Reader<TInput>, WireType)

Reads a variable-width UInt32.

ReadUInt64<TInput>(Reader<TInput>, WireType)

Reads a variable-width UInt64.

ReadUInt8<TInput>(Reader<TInput>, WireType)

Reads a variable-width Byte.

ReadVarInt16<TInput>(Reader<TInput>)

Reads a variable-width UInt16.

ReadVarInt32<TInput>(Reader<TInput>)

Reads a variable-width Int32.

ReadVarInt64<TInput>(Reader<TInput>)

Reads a variable-width Int64.

ReadVarInt8<TInput>(Reader<TInput>)

Reads a variable-width SByte.

ReadVarUInt16<TInput>(Reader<TInput>)

Reads a variable-width UInt16.

ReadVarUInt8<TInput>(Reader<TInput>)

Reads a variable-width Byte.

ConsumeUnknownField<TInput>(Reader<TInput>, Field)

Consumes an unknown field.

ConsumeUnknownField<TInput>(Reader<TInput>, Field)

Consumes an unknown field.

ReadFieldHeader<TInput>(Reader<TInput>, Field)

Reads a field header.

ReadFieldHeader<TInput>(Reader<TInput>)

Reads a field header.

ReadFieldHeaderForAnalysis<TInput>(Reader<TInput>)

Reads a field header for diagnostic purposes.

SkipField<TInput>(Reader<TInput>, Field)

Skips the current field.

ConsumeEndBaseOrEndObject<TInput>(Reader<TInput>, Field)

Expects empty content (a single field header of either EndBaseFields or EndTagDelimited), but will consume any unexpected fields also.

ConsumeEndBaseOrEndObject<TInput>(Reader<TInput>)

Expects empty content (a single field header of either EndBaseFields or EndTagDelimited), but will consume any unexpected fields also.

DeserializeUnexpectedType<TInput,TField>(Reader<TInput>, Field)

Deserializes an unexpected value.

Applies to