語言

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 值或根級值序列。

適用於