語言

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的位元組數。

傳回

true若destination有足夠長度接收該值且讀取器前進;否則,。 false

例外狀況

下一個資料項目沒有正確的主要類型。

下一個值的 CBOR 編碼無效。

-或-

CBOR 編碼資料意外終止。

-或-

下一個值使用了在當前相容模式下無效的 CBOR 編碼。

備註

此方法接受無限長度的字串,並將其串接到單一字串。

適用於