语言

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

定义

尝试将数据的编码表示形式 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>

要在其中写入的缓冲区。

bytesWritten
Int32

此方法返回时,包含写入到 destination的字节数。

返回

true 如果编码成功, false 则为 destination 过小。

例外

编写器不包含完整的 CBOR 值或根级值的序列。

适用于