Share via


AsnDecoder.ReadSequence 方法

定義

在指定的編碼規則下,從 source 讀取具有所指定標籤的 Sequence 或 Sequence-Of 值。

public static void ReadSequence (ReadOnlySpan<byte> source, System.Formats.Asn1.AsnEncodingRules ruleSet, out int contentOffset, out int contentLength, out int bytesConsumed, System.Formats.Asn1.Asn1Tag? expectedTag = default);
static member ReadSequence : ReadOnlySpan<byte> * System.Formats.Asn1.AsnEncodingRules * int * int * int * Nullable<System.Formats.Asn1.Asn1Tag> -> unit
Public Shared Sub ReadSequence (source As ReadOnlySpan(Of Byte), ruleSet As AsnEncodingRules, ByRef contentOffset As Integer, ByRef contentLength As Integer, ByRef bytesConsumed As Integer, Optional expectedTag As Nullable(Of Asn1Tag) = Nothing)

參數

source
ReadOnlySpan<Byte>

包含編碼資料的緩衝區。

ruleSet
AsnEncodingRules

要在解譯資料時使用的編碼條件約束。

contentOffset
Int32

當此方法傳回時,相對於 source 開頭的內容承載位移。 這個參數會被視為未初始化。

contentLength
Int32

當此方法傳回時,內容承載中的位元組數 (可能是 0)。 這個參數會被視為未初始化。

bytesConsumed
Int32

當此方法傳回時,編碼值的位元組總數。 這個參數會被視為未初始化。

expectedTag
Nullable<Asn1Tag>

要在讀取之前檢查的標籤,或預設標籤的 null (Universal 16)。

例外狀況

未定義ruleSet

下一個值沒有正確的標記。

-或-

目前編碼規則下的長度編碼無效。

-或-

內容在目前的編碼規則下無效。

expectedTagTagClassUniversal,但 expectedTagTagValue 對方法而言不正確。

備註

這個方法不會評估巢狀內容,但要判斷內容結束標記位置的最小處理除外。 因此,內容可能包含目前編碼規則下無效的數據。

適用於