AsnDecoder.TryReadPrimitiveCharacterStringBytes 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
嘗試從指定標籤中取得未處理的字串值 source ,若該值包含於單一(原始)編碼中,則依指定編碼規則執行指定標籤。
public:
static bool TryReadPrimitiveCharacterStringBytes(ReadOnlySpan<System::Byte> source, System::Formats::Asn1::AsnEncodingRules ruleSet, System::Formats::Asn1::Asn1Tag expectedTag, [Runtime::InteropServices::Out] ReadOnlySpan<System::Byte> % value, [Runtime::InteropServices::Out] int % bytesConsumed);
public static bool TryReadPrimitiveCharacterStringBytes(ReadOnlySpan<byte> source, System.Formats.Asn1.AsnEncodingRules ruleSet, System.Formats.Asn1.Asn1Tag expectedTag, out ReadOnlySpan<byte> value, out int bytesConsumed);
static member TryReadPrimitiveCharacterStringBytes : ReadOnlySpan<byte> * System.Formats.Asn1.AsnEncodingRules * System.Formats.Asn1.Asn1Tag * ReadOnlySpan * int -> bool
Public Shared Function TryReadPrimitiveCharacterStringBytes (source As ReadOnlySpan(Of Byte), ruleSet As AsnEncodingRules, expectedTag As Asn1Tag, ByRef value As ReadOnlySpan(Of Byte), ByRef bytesConsumed As Integer) As Boolean
參數
- source
- ReadOnlySpan<Byte>
緩衝區內包含編碼資料。
- ruleSet
- AsnEncodingRules
解讀資料時應使用的編碼約束。
- expectedTag
- Asn1Tag
閱讀前要先確認標籤。
- value
- ReadOnlySpan<Byte>
成功時,會收到對應於位元字串值的輸入緩衝區切片。 此參數被視為未初始化。
- bytesConsumed
- Int32
當此方法回傳時,會顯示編碼值的總位元組數。 此參數被視為未初始化。
傳回
true如果字串值有原始編碼;否則,。 false
例外狀況
ruleSet 尚未定義。
備註
此方法無法判斷字串是否僅使用編碼定義的字元。