Utf8JsonReader 建構函式

定義

多載

Utf8JsonReader(ReadOnlySequence<Byte>, JsonReaderOptions)

使用指定的選項初始化 Utf8JsonReader 結構的新執行個體,以處理 UTF-8 編碼文字的唯讀序列。

Utf8JsonReader(ReadOnlySpan<Byte>, JsonReaderOptions)

使用指定的選項初始化 Utf8JsonReader 結構的新執行個體,以處理 UTF-8 編碼文字的唯讀範圍。

Utf8JsonReader(ReadOnlySequence<Byte>, Boolean, JsonReaderState)

初始化 Utf8JsonReader 結構的新執行個體,以處理 UTF-8 編碼文字的唯讀序列,並指出輸入是否包含要處理的所有文字。

Utf8JsonReader(ReadOnlySpan<Byte>, Boolean, JsonReaderState)

初始化 Utf8JsonReader 結構的新執行個體,以處理 UTF-8 編碼文字的唯讀反為,並指出輸入是否包含要處理的所有文字。

Utf8JsonReader(ReadOnlySequence<Byte>, JsonReaderOptions)

使用指定的選項初始化 Utf8JsonReader 結構的新執行個體,以處理 UTF-8 編碼文字的唯讀序列。

public Utf8JsonReader (System.Buffers.ReadOnlySequence<byte> jsonData, System.Text.Json.JsonReaderOptions options = default);
new System.Text.Json.Utf8JsonReader : System.Buffers.ReadOnlySequence<byte> * System.Text.Json.JsonReaderOptions -> System.Text.Json.Utf8JsonReader
Public Sub New (jsonData As ReadOnlySequence(Of Byte), Optional options As JsonReaderOptions = Nothing)

參數

jsonData
ReadOnlySequence<Byte>

要處理的 UTF-8 編碼 JSON 文字。

options
JsonReaderOptions

定義不同於 JSON RFC 的自訂 Utf8JsonReader 行為 (例如,處理註解的方式或讀取時允許的最大深度)。 根據預設,Utf8JsonReader 會嚴格遵循 JSON RFC;JSON 內的註解無效,且最大深度是 64。

備註

因為此類型是 ref 結構,所以它是僅限堆疊的類型,而且 ref 結構的所有限制都會套用至它。

此建構函式假設整個 JSON 承載都包含在 中 jsonData ,它相當於 = Utf8JsonReader.IsFinalBlock true

適用於

Utf8JsonReader(ReadOnlySpan<Byte>, JsonReaderOptions)

使用指定的選項初始化 Utf8JsonReader 結構的新執行個體,以處理 UTF-8 編碼文字的唯讀範圍。

public Utf8JsonReader (ReadOnlySpan<byte> jsonData, System.Text.Json.JsonReaderOptions options = default);
new System.Text.Json.Utf8JsonReader : ReadOnlySpan<byte> * System.Text.Json.JsonReaderOptions -> System.Text.Json.Utf8JsonReader
Public Sub New (jsonData As ReadOnlySpan(Of Byte), Optional options As JsonReaderOptions = Nothing)

參數

jsonData
ReadOnlySpan<Byte>

要處理的 UTF-8 編碼 JSON 文字。

options
JsonReaderOptions

定義不同於 JSON RFC 的自訂 Utf8JsonReader 行為 (例如,處理註解的方式或讀取時允許的最大深度)。 根據預設,Utf8JsonReader 會嚴格遵循 JSON RFC;JSON 內的註解無效,且最大深度是 64。

備註

因為此類型是 ref 結構,所以它是僅限堆疊的類型,而且 ref 結構的所有限制都會套用至它。

此建構函式假設整個 JSON 承載都包含在 中 jsonData ,它相當於 = Utf8JsonReader.IsFinalBlock true

適用於

Utf8JsonReader(ReadOnlySequence<Byte>, Boolean, JsonReaderState)

初始化 Utf8JsonReader 結構的新執行個體,以處理 UTF-8 編碼文字的唯讀序列,並指出輸入是否包含要處理的所有文字。

public:
 Utf8JsonReader(System::Buffers::ReadOnlySequence<System::Byte> jsonData, bool isFinalBlock, System::Text::Json::JsonReaderState state);
public Utf8JsonReader (System.Buffers.ReadOnlySequence<byte> jsonData, bool isFinalBlock, System.Text.Json.JsonReaderState state);
new System.Text.Json.Utf8JsonReader : System.Buffers.ReadOnlySequence<byte> * bool * System.Text.Json.JsonReaderState -> System.Text.Json.Utf8JsonReader
Public Sub New (jsonData As ReadOnlySequence(Of Byte), isFinalBlock As Boolean, state As JsonReaderState)

參數

jsonData
ReadOnlySequence<Byte>

要處理的 UTF-8 編碼 JSON 文字。

isFinalBlock
Boolean

true 表示輸入序列包含要處理的整個資料;false 表示輸入範圍包含有更多資料可供追蹤的部分資料。

state
JsonReaderState

包含讀取器狀態的物件。 如果這是第一次呼叫建構函式,請傳遞預設狀態;否則傳遞來自先前 Utf8JsonReader 執行個體的 CurrentState 屬性值。

備註

因為此類型是 ref 結構,所以它是僅限堆疊的類型,而且 ref 結構的所有限制都會套用至它。 這是建構函式接受 JsonReaderState 的原因。

適用於

Utf8JsonReader(ReadOnlySpan<Byte>, Boolean, JsonReaderState)

初始化 Utf8JsonReader 結構的新執行個體,以處理 UTF-8 編碼文字的唯讀反為,並指出輸入是否包含要處理的所有文字。

public:
 Utf8JsonReader(ReadOnlySpan<System::Byte> jsonData, bool isFinalBlock, System::Text::Json::JsonReaderState state);
public Utf8JsonReader (ReadOnlySpan<byte> jsonData, bool isFinalBlock, System.Text.Json.JsonReaderState state);
new System.Text.Json.Utf8JsonReader : ReadOnlySpan<byte> * bool * System.Text.Json.JsonReaderState -> System.Text.Json.Utf8JsonReader
Public Sub New (jsonData As ReadOnlySpan(Of Byte), isFinalBlock As Boolean, state As JsonReaderState)

參數

jsonData
ReadOnlySpan<Byte>

要處理的 UTF-8 編碼 JSON 文字。

isFinalBlock
Boolean

true 表示輸入序列包含要處理的整個資料;false 表示輸入範圍包含有更多資料可供追蹤的部分資料。

state
JsonReaderState

包含讀取器狀態的物件。 如果這是第一次呼叫建構函式,請傳遞預設狀態;否則傳遞來自先前 Utf8JsonReader 執行個體的 CurrentState 屬性值。

備註

因為此類型是 ref 結構,所以它是僅限堆疊的類型,而且 ref 結構的所有限制都會套用至它。 這是建構函式接受 JsonReaderState 的原因。

適用於