Asn1Tag.TryDecode(ReadOnlySpan<Byte>, Asn1Tag, Int32) 方法
定义
尝试读取从 source 开始的 BER 编码的标记。Attempts to read a BER-encoded tag which starts at source.
public:
static bool TryDecode(ReadOnlySpan<System::Byte> source, [Runtime::InteropServices::Out] System::Formats::Asn1::Asn1Tag % tag, [Runtime::InteropServices::Out] int % bytesConsumed);
public static bool TryDecode (ReadOnlySpan<byte> source, out System.Formats.Asn1.Asn1Tag tag, out int bytesConsumed);
static member TryDecode : ReadOnlySpan<byte> * Asn1Tag * int -> bool
Public Shared Function TryDecode (source As ReadOnlySpan(Of Byte), ByRef tag As Asn1Tag, ByRef bytesConsumed As Integer) As Boolean
参数
- source
- ReadOnlySpan<Byte>
开头为 BER 编码的标记的只读字节序列。The read only byte sequence whose beginning is a BER-encoded tag.
- tag
- Asn1Tag
解码的标记。The decoded tag.
- bytesConsumed
- Int32
当此方法返回时,包含构成编码标记的字节数,失败时为 0。When this method returns, contains the number of bytes that contributed to the encoded tag, 0 on failure. 该参数未经初始化即被处理。This parameter is treated as uninitialized.
返回
如果标记已正确解码,则为 true;否则为 false。true if a tag was correctly decoded; otherwise, false.