AsnReader.ReadIntegerBytes(Nullable<Asn1Tag>) 方法

定义

读取下一个值,作为带有指定标记的整数值,并以原始数据的 ReadOnlyMemory<T> 的形式返回内容。Reads the next value as a Integer with a specified tag, returning the contents as a ReadOnlyMemory<T> over the original data.

public ReadOnlyMemory<byte> ReadIntegerBytes (System.Formats.Asn1.Asn1Tag? expectedTag = default);
member this.ReadIntegerBytes : Nullable<System.Formats.Asn1.Asn1Tag> -> ReadOnlyMemory<byte>
Public Function ReadIntegerBytes (Optional expectedTag As Nullable(Of Asn1Tag) = Nothing) As ReadOnlyMemory(Of Byte)

参数

expectedTag
Nullable<Asn1Tag>

读取前要检查的标记,或使用 null 作为默认标记(通用 2)。The tag to check for before reading, or null for the default tag (Universal 2).

返回

ReadOnlyMemory<Byte>

带符号的 Big Endian 格式的整数值的字节数。The bytes of the Integer value, in signed big-endian form.

例外

下一个值没有正确的标记。the next value does not have the correct tag. -或- 在当前编码规则下,长度编码无效。-or- the length encoding is not valid under the current encoding rules. -或- 在当前编码规则下,内容无效。-or- the contents are not valid under the current encoding rules.

expectedTag.TagClassexpectedTag.TagClass Universal,但 expectedTag.TagValueis Universal, but expectedTag.TagValue 对于此方法而言是不正确的。is not correct for the method.

适用于