Skip to content

VarIntReaderExtensions Methods

Extension method for working with variable-width integers.

ReadInt16(Reader<TInput>, WireType)

staticextension
View source
public static short ReadInt16<TInput>(this ref Reader<TInput> reader, WireType wireType)
Reads a variable-width System.Int16.

Parameters

readerReader<TInput>
The reader.
wireTypeWireType
The wire type.

Returns

A variable-width integer.

ReadInt32(Reader<TInput>, WireType)

staticextension
View source
public static int ReadInt32<TInput>(this ref Reader<TInput> reader, WireType wireType)
Reads a variable-width System.Int32.

Parameters

readerReader<TInput>
The reader.
wireTypeWireType
The wire type.

Returns

A variable-width integer.

ReadInt64(Reader<TInput>, WireType)

staticextension
View source
public static long ReadInt64<TInput>(this ref Reader<TInput> reader, WireType wireType)
Reads a variable-width System.Int64.

Parameters

readerReader<TInput>
The reader.
wireTypeWireType
The wire type.

Returns

A variable-width integer.

ReadInt8(Reader<TInput>, WireType)

staticextension
View source
public static sbyte ReadInt8<TInput>(this ref Reader<TInput> reader, WireType wireType)
Reads a variable-width System.SByte.

Parameters

readerReader<TInput>
The reader.
wireTypeWireType
The wire type.

Returns

A variable-width integer.

ReadUInt16(Reader<TInput>, WireType)

staticextension
View source
public static ushort ReadUInt16<TInput>(this ref Reader<TInput> reader, WireType wireType)
Reads a variable-width System.UInt16.

Parameters

readerReader<TInput>
The reader.
wireTypeWireType
The wire type.

Returns

A variable-width integer.

ReadUInt32(Reader<TInput>, WireType)

staticextension
View source
public static uint ReadUInt32<TInput>(this ref Reader<TInput> reader, WireType wireType)
Reads a variable-width System.UInt32.

Parameters

readerReader<TInput>
The reader.
wireTypeWireType
The wire type.

Returns

A variable-width integer.

ReadUInt64(Reader<TInput>, WireType)

staticextension
View source
public static ulong ReadUInt64<TInput>(this ref Reader<TInput> reader, WireType wireType)
Reads a variable-width System.UInt64.

Parameters

readerReader<TInput>
The reader.
wireTypeWireType
The wire type.

Returns

A variable-width integer.

ReadUInt8(Reader<TInput>, WireType)

staticextension
View source
public static byte ReadUInt8<TInput>(this ref Reader<TInput> reader, WireType wireType)
Reads a variable-width System.Byte.

Parameters

readerReader<TInput>
The reader.
wireTypeWireType
The wire type.

Returns

A variable-width integer.

ReadVarInt16(Reader<TInput>)

staticextension
View source
public static short ReadVarInt16<TInput>(this ref Reader<TInput> reader)
Reads a variable-width System.UInt16.

Parameters

readerReader<TInput>
The reader.

Returns

A variable-width integer.

ReadVarInt32(Reader<TInput>)

staticextension
View source
public static int ReadVarInt32<TInput>(this ref Reader<TInput> reader)
Reads a variable-width System.Int32.

Parameters

readerReader<TInput>
The reader.

Returns

A variable-width integer.

ReadVarInt64(Reader<TInput>)

staticextension
View source
public static long ReadVarInt64<TInput>(this ref Reader<TInput> reader)
Reads a variable-width System.Int64.

Parameters

readerReader<TInput>
The reader.

Returns

A variable-width integer.

ReadVarInt8(Reader<TInput>)

staticextension
View source
public static sbyte ReadVarInt8<TInput>(this ref Reader<TInput> reader)
Reads a variable-width System.SByte.

Parameters

readerReader<TInput>
The reader.

Returns

A variable-width integer.

ReadVarUInt16(Reader<TInput>)

staticextension
View source
public static ushort ReadVarUInt16<TInput>(this ref Reader<TInput> reader)
Reads a variable-width System.UInt16.

Parameters

readerReader<TInput>
The reader.

Returns

A variable-width integer.

ReadVarUInt8(Reader<TInput>)

staticextension
View source
public static byte ReadVarUInt8<TInput>(this ref Reader<TInput> reader)
Reads a variable-width System.Byte.

Parameters

readerReader<TInput>
The reader.

Returns

A variable-width integer.