语言

CborReader.TryReadTextString(Span<Char>, Int32) 方法

定义

将下一个数据项读取为 UTF-8 文本字符串(主要类型 3)。

public:
 bool TryReadTextString(Span<char> destination, [Runtime::InteropServices::Out] int % charsWritten);
public bool TryReadTextString(Span<char> destination, out int charsWritten);
member this.TryReadTextString : Span<char> * int -> bool
Public Function TryReadTextString (destination As Span(Of Char), ByRef charsWritten As Integer) As Boolean

参数

destination
Span<Char>

要在其中写入的缓冲区。

charsWritten
Int32

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

返回

true 如果有足够的长度来接收该值,则前进读取器 destination ,否则 false 读取器不会前进。

例外

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

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

-或-

CBOR 编码数据意外结束。

-或-

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

注解

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

适用于