语言

CborReader.TryReadByteString(Span<Byte>, Int32) 方法

定义

将下一个数据项读取为字节字符串(主要类型 2)。

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

参数

destination
Span<Byte>

要在其中写入读取字节的缓冲区。

bytesWritten
Int32

成功后,接收写入到 destination的字节数。

返回

如果 有足够的长度来接收该值,并且读取器会前进,则为 。

例外

下一个数据项没有正确的主类型。

下一个值具有无效的 CBOR 编码。

-或-

CBOR 编码数据意外结束。

-或-

下一个值使用在当前一致性模式下无效的 CBOR 编码。

注解

该方法接受无限长度字符串,它将连接到单个字符串。

适用于