CborWriter.Encode 方法

定义

重载

Encode()

返回包含已编码值的新数组。

Encode(Span<Byte>)

将数据的已编码表示形式写入 destination

Encode()

Source:
CborWriter.cs
Source:
CborWriter.cs
Source:
CborWriter.cs

返回包含已编码值的新数组。

public:
 cli::array <System::Byte> ^ Encode();
public byte[] Encode ();
member this.Encode : unit -> byte[]
Public Function Encode () As Byte()

返回

Byte[]

一个包含编码值的精确大小的数组。

例外

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

适用于

Encode(Span<Byte>)

Source:
CborWriter.cs
Source:
CborWriter.cs
Source:
CborWriter.cs

将数据的已编码表示形式写入 destination

public:
 int Encode(Span<System::Byte> destination);
public int Encode (Span<byte> destination);
member this.Encode : Span<byte> -> int
Public Function Encode (destination As Span(Of Byte)) As Integer

参数

destination
Span<Byte>

要写入的缓冲区。

返回

写入到 destination 的字节数。

例外

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

目标缓冲区不够大,无法保留已编码值。

适用于