Share via


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 的字节数。

返回

如果 destination 有足够的长度来接收值并推进读取器,则为 true;否则为 false

例外

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

下一个值的 CBOR 编码无效。

CBOR 编码数据的结尾异常。

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

注解

方法接受无限长字符串,这些字符串将连接到单个字符串。

适用于