一款简单易用的基础网络通讯组件库。

ReaderExtensionReadVarUInt32TReader(TReader) 方法

从字节读取器中读取可变长度编码的无符号32位整数。

Definition

命名空间: TouchSocket.Core
程序集: TouchSocket.Core (在 TouchSocket.Core.dll 中) 版本:4.0.0-beta.143+5fcca7a4e70968794985dc3793adc50531308be6
C#
public static uint ReadVarUInt32<TReader>(
	ref TReader reader
)
where TReader : IBytesReader

参数

reader  TReader
字节读取器实例。

类型参数

TReader
实现IBytesReader接口的读取器类型。

返回值

UInt32
读取的UInt32值。

备注

此方法实现了VarInt编码的解码,每个字节的最高位作为继续位, 低7位作为数据位。当最高位为0时表示最后一个字节。

参见