AsnDecoder.ReadEncodedValue 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
利用指定的編碼規則,在緩衝區起始 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值將大於 和 contentLength 的contentOffset總和,以考慮目錄結束標記。