AsnReader.TryReadInt64(Int64, Nullable<Asn1Tag>) 方法

定义

尝试读取下一个带有指定标记并作为有符号的 64 位值的整数值。Attempts to read the next value as an Integer with a specified tag, as a signed 64-bit value.

public bool TryReadInt64 (out long value, System.Formats.Asn1.Asn1Tag? expectedTag = default);
member this.TryReadInt64 : int64 * Nullable<System.Formats.Asn1.Asn1Tag> -> bool
Public Function TryReadInt64 (ByRef value As Long, Optional expectedTag As Nullable(Of Asn1Tag) = Nothing) As Boolean

参数

value
Int64

成功后,将收到解码后的值。On success, receives the decoded value.

expectedTag
Nullable<Asn1Tag>

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

返回

Boolean

如果值不在 MinValueMaxValue(含)之间,则为 false,并且不会推进读取器;否则,将返回 true,且读取器会前进。false and does not advance the reader if the value is not between MinValue and MaxValue, inclusive; otherwise true is returned and the reader advances.

例外

下一个值没有正确的标记。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.

适用于