Share via


AsnDecoder.ReadEncodedValue 方法

定義

使用指定的編碼規則,尋找 source 緩衝區開頭處編碼值的內容範圍。

public:
 static System::Formats::Asn1::Asn1Tag ReadEncodedValue(ReadOnlySpan<System::Byte> source, System::Formats::Asn1::AsnEncodingRules ruleSet, [Runtime::InteropServices::Out] int % contentOffset, [Runtime::InteropServices::Out] int % contentLength, [Runtime::InteropServices::Out] int % bytesConsumed);
public static System.Formats.Asn1.Asn1Tag ReadEncodedValue (ReadOnlySpan<byte> source, System.Formats.Asn1.AsnEncodingRules ruleSet, out int contentOffset, out int contentLength, out int bytesConsumed);
static member ReadEncodedValue : ReadOnlySpan<byte> * System.Formats.Asn1.AsnEncodingRules * int * int * int -> System.Formats.Asn1.Asn1Tag
Public Shared Function ReadEncodedValue (source As ReadOnlySpan(Of Byte), ruleSet As AsnEncodingRules, ByRef contentOffset As Integer, ByRef contentLength As Integer, ByRef bytesConsumed As Integer) As Asn1Tag

參數

source
ReadOnlySpan<Byte>

包含編碼資料的緩衝區。

ruleSet
AsnEncodingRules

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

contentOffset
Int32

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

contentLength
Int32

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

bytesConsumed
Int32

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

傳回

識別內容的標籤。

例外狀況

未定義 ruleSet

source 不代表在指定編碼規則下編碼的值。

備註

此方法對內容執行非常少的驗證。 如果編碼的值使用明確的長度,則完全不會檢查內容。 如果編碼值使用無限長度,則只會視需要檢查內容,以判斷相關內容結尾標記的位置。

當編碼值使用無限長度時, bytesConsumed 該值會大於 和的總 contentOffsetcontentLength ,以考慮內容結束標記。

適用於