语言

ValueAsnReader.TryReadBitString 方法

定义

将下一个值作为具有指定标记的 BIT STRING 读取,并将该值复制到提供的目标缓冲区中。

public bool TryReadBitString(Span<byte> destination, out int unusedBitCount, out int bytesWritten, System.Formats.Asn1.Asn1Tag? expectedTag = default);
member this.TryReadBitString : Span<byte> * int * int * Nullable<System.Formats.Asn1.Asn1Tag> -> bool
Public Function TryReadBitString (destination As Span(Of Byte), ByRef unusedBitCount As Integer, ByRef bytesWritten As Integer, Optional expectedTag As Nullable(Of Asn1Tag) = Nothing) As Boolean

参数

destination
Span<Byte>

要在其中写入的缓冲区。

unusedBitCount
Int32

成功后,接收写入器报告为“未使用的”最后一个字节中的位数。

bytesWritten
Int32

成功后,接收写入到 destination的字节数。

expectedTag
Nullable<Asn1Tag>

在读取之前要检查的标记,或 null 默认标记(通用 3)。

返回

true 如果有足够的长度来接收该值,则前进读取器 destination ,否则 false 读取器不会前进。

例外

下一个值没有正确的标记。

-或-

长度编码在当前编码规则下无效。

-或-

内容在当前编码规则下无效。

expectedTag。TagClass是Universal,但expectedTagTagValue该方法不正确。

适用于

另请参阅