Utf8JsonReader 建構函式

定義

多載

名稱 Description
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.MultiSegment.cs
來源:
Utf8JsonReader.MultiSegment.cs
來源:
Utf8JsonReader.MultiSegment.cs
來源:
Utf8JsonReader.MultiSegment.cs
來源:
Utf8JsonReader.MultiSegment.cs
來源:
Utf8JsonReader.MultiSegment.cs
來源:
Utf8JsonReader.MultiSegment.cs

初始化一個新的結構實例,該實例 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

定義自訂行為 Utf8JsonReader 的選項,與 JSON RFC 不同(例如如何處理註解或閱讀時允許的最大深度)。 預設情況下,它 Utf8JsonReader 嚴格遵循 JSON RFC;JSON 內的註解無效,且最大深度為 64。

備註

由於此類型是 ref struct,故僅為堆疊型別,且所有 ref 結構式的限制都適用於它。

此建構子假設整個 JSON 有效載荷包含於 jsonData;它等價 Utf8JsonReader.IsFinalBlock = true於 。

適用於

Utf8JsonReader(ReadOnlySpan<Byte>, JsonReaderOptions)

來源:
Utf8JsonReader.cs
來源:
Utf8JsonReader.cs
來源:
Utf8JsonReader.cs
來源:
Utf8JsonReader.cs
來源:
Utf8JsonReader.cs
來源:
Utf8JsonReader.cs
來源:
Utf8JsonReader.cs

初始化一個新的結構實例,該實例 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

定義自訂行為 Utf8JsonReader 的選項,與 JSON RFC 不同(例如如何處理註解或閱讀時允許的最大深度)。 預設情況下,它 Utf8JsonReader 嚴格遵循 JSON RFC;JSON 內的註解無效,且最大深度為 64。

備註

由於此類型是 ref struct,故僅為堆疊型別,且所有 ref 結構式的限制都適用於它。

此建構子假設整個 JSON 有效載荷包含於 jsonData;它等價 Utf8JsonReader.IsFinalBlock = true於 。

適用於

Utf8JsonReader(ReadOnlySequence<Byte>, Boolean, JsonReaderState)

來源:
Utf8JsonReader.MultiSegment.cs
來源:
Utf8JsonReader.MultiSegment.cs
來源:
Utf8JsonReader.MultiSegment.cs
來源:
Utf8JsonReader.MultiSegment.cs
來源:
Utf8JsonReader.MultiSegment.cs
來源:
Utf8JsonReader.MultiSegment.cs
來源:
Utf8JsonReader.MultiSegment.cs

初始化一個新的結構實例 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 struct,故僅為堆疊型別,且所有 ref 結構式的限制都適用於它。 這也是構造子接受 的原因 JsonReaderState

適用於

Utf8JsonReader(ReadOnlySpan<Byte>, Boolean, JsonReaderState)

來源:
Utf8JsonReader.cs
來源:
Utf8JsonReader.cs
來源:
Utf8JsonReader.cs
來源:
Utf8JsonReader.cs
來源:
Utf8JsonReader.cs
來源:
Utf8JsonReader.cs
來源:
Utf8JsonReader.cs

初始化一個新的結構實例 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 struct,故僅為堆疊型別,且所有 ref 結構式的限制都適用於它。 這也是構造子接受 的原因 JsonReaderState

適用於