Utf8JsonReader 构造函数

定义

重载

名称 说明
Utf8JsonReader(ReadOnlySequence<Byte>, JsonReaderOptions)

初始化使用指定选项处理 UTF-8 编码文本的只读序列的结构的新实例 Utf8JsonReader

Utf8JsonReader(ReadOnlySpan<Byte>, JsonReaderOptions)

初始化使用指定选项处理 UTF-8 编码文本的只读范围的结构的新实例 Utf8JsonReader

Utf8JsonReader(ReadOnlySequence<Byte>, Boolean, JsonReaderState)

初始化结构的新实例,该结构 Utf8JsonReader 处理 UTF-8 编码文本的只读序列,并指示输入是否包含要处理的所有文本。

Utf8JsonReader(ReadOnlySpan<Byte>, Boolean, JsonReaderState)

初始化结构的新实例,该结构 Utf8JsonReader 处理 UTF-8 编码文本的只读范围,并指示输入是否包含要处理的所有文本。

Utf8JsonReader(ReadOnlySequence<Byte>, JsonReaderOptions)

Source:
Utf8JsonReader.MultiSegment.cs
Source:
Utf8JsonReader.MultiSegment.cs
Source:
Utf8JsonReader.MultiSegment.cs
Source:
Utf8JsonReader.MultiSegment.cs
Source:
Utf8JsonReader.MultiSegment.cs
Source:
Utf8JsonReader.MultiSegment.cs
Source:
Utf8JsonReader.MultiSegment.cs

初始化使用指定选项处理 UTF-8 编码文本的只读序列的结构的新实例 Utf8JsonReader

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)

Source:
Utf8JsonReader.cs
Source:
Utf8JsonReader.cs
Source:
Utf8JsonReader.cs
Source:
Utf8JsonReader.cs
Source:
Utf8JsonReader.cs
Source:
Utf8JsonReader.cs
Source:
Utf8JsonReader.cs

初始化使用指定选项处理 UTF-8 编码文本的只读范围的结构的新实例 Utf8JsonReader

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)

Source:
Utf8JsonReader.MultiSegment.cs
Source:
Utf8JsonReader.MultiSegment.cs
Source:
Utf8JsonReader.MultiSegment.cs
Source:
Utf8JsonReader.MultiSegment.cs
Source:
Utf8JsonReader.MultiSegment.cs
Source:
Utf8JsonReader.MultiSegment.cs
Source:
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 结构,因此它是仅堆栈类型,并且 ref 结构的所有限制都适用于它。 这是构造函数接受 a JsonReaderState.

适用于

Utf8JsonReader(ReadOnlySpan<Byte>, Boolean, JsonReaderState)

Source:
Utf8JsonReader.cs
Source:
Utf8JsonReader.cs
Source:
Utf8JsonReader.cs
Source:
Utf8JsonReader.cs
Source:
Utf8JsonReader.cs
Source:
Utf8JsonReader.cs
Source:
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 结构,因此它是仅堆栈类型,并且 ref 结构的所有限制都适用于它。 这是构造函数接受 a JsonReaderState.

适用于