语言

ValueAsnReader.TryReadCharacterStringBytes 方法

定义

将下一个值作为具有指定标记的字符串读取,并将未处理的字节复制到提供的目标缓冲区中。

public:
 bool TryReadCharacterStringBytes(Span<System::Byte> destination, System::Formats::Asn1::Asn1Tag expectedTag, [Runtime::InteropServices::Out] int % bytesWritten);
public bool TryReadCharacterStringBytes(Span<byte> destination, System.Formats.Asn1.Asn1Tag expectedTag, out int bytesWritten);
member this.TryReadCharacterStringBytes : Span<byte> * System.Formats.Asn1.Asn1Tag * int -> bool
Public Function TryReadCharacterStringBytes (destination As Span(Of Byte), expectedTag As Asn1Tag, ByRef bytesWritten As Integer) As Boolean

参数

destination
Span<Byte>

要在其中写入的缓冲区。

expectedTag
Asn1Tag

在读取之前要检查的标记。

bytesWritten
Int32

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

返回

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

例外

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

-或-

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

-或-

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

expectedTag。TagClass是Universal,但expectedTagTagValue不是字符串标记类型。

注解

此方法不确定字符串是否只使用编码定义的字符。

适用于

另请参阅