語言

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,但 expectedTag。TagValue 不是字串標籤類型。

備註

此方法無法判斷字串是否僅使用編碼定義的字元。

適用於

另請參閱