Asn1Tag.TryEncode(Span<Byte>, Int32) 方法

定义

尝试将此标记的 BER 编码形式写入到 destinationAttempts to write the BER-encoded form of this tag to destination.

public:
 bool TryEncode(Span<System::Byte> destination, [Runtime::InteropServices::Out] int % bytesWritten);
public bool TryEncode (Span<byte> destination, out int bytesWritten);
member this.TryEncode : Span<byte> * int -> bool
Public Function TryEncode (destination As Span(Of Byte), ByRef bytesWritten As Integer) As Boolean

参数

destination
Span<Byte>

应将编码标记写入到的位置的开头。The start of where the encoded tag should be written.

bytesWritten
Int32

成功时将收到 CalculateEncodedSize() 的值,失败时为 0。Receives the value from CalculateEncodedSize() on success, 0 on failure.

返回

Boolean

如果为以下值则为 falsedestination.Lengthfalse if destination.Length < CalculateEncodedSize()(),否则为 true< CalculateEncodedSize()(), true otherwise.

适用于