Utf8JsonReader Constructors

Definition

Overloads

Utf8JsonReader(ReadOnlySequence<Byte>, JsonReaderOptions)

Initializes a new instance of the Utf8JsonReader structure that processes a read-only sequence of UTF-8 encoded text using the specified options.

Utf8JsonReader(ReadOnlySpan<Byte>, JsonReaderOptions)

Initializes a new instance of the Utf8JsonReader structure that processes a read-only span of UTF-8 encoded text using the specified options.

Utf8JsonReader(ReadOnlySequence<Byte>, Boolean, JsonReaderState)

Initializes a new instance of the Utf8JsonReader structure that processes a read-only sequence of UTF-8 encoded text and indicates whether the input contains all the text to process.

Utf8JsonReader(ReadOnlySpan<Byte>, Boolean, JsonReaderState)

Initializes a new instance of the Utf8JsonReader structure that processes a read-only span of UTF-8 encoded text and indicates whether the input contains all the text to process.

Utf8JsonReader(ReadOnlySequence<Byte>, JsonReaderOptions)

Initializes a new instance of the Utf8JsonReader structure that processes a read-only sequence of UTF-8 encoded text using the specified options.

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)

Parameters

jsonData
ReadOnlySequence<Byte>

The UTF-8 encoded JSON text to process.

options
JsonReaderOptions

Defines customized behavior of the Utf8JsonReader that differs from the JSON RFC (for example how to handle comments or maximum depth allowed when reading). By default, the Utf8JsonReader follows the JSON RFC strictly; comments within the JSON are invalid, and the maximum depth is 64.

Remarks

Since this type is a ref struct, it is a stack-only type, and all the limitations of ref structs apply to it.

This constructor assumes that the entire JSON payload is contained in jsonData; it is equivalent to Utf8JsonReader.IsFinalBlock = true.

Applies to

Utf8JsonReader(ReadOnlySpan<Byte>, JsonReaderOptions)

Initializes a new instance of the Utf8JsonReader structure that processes a read-only span of UTF-8 encoded text using the specified options.

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)

Parameters

jsonData
ReadOnlySpan<Byte>

The UTF-8 encoded JSON text to process.

options
JsonReaderOptions

Defines customized behavior of the Utf8JsonReader that differs from the JSON RFC (for example how to handle comments or maximum depth allowed when reading). By default, the Utf8JsonReader follows the JSON RFC strictly; comments within the JSON are invalid, and the maximum depth is 64.

Remarks

Since this type is a ref struct, it is a stack-only type, and all the limitations of ref structs apply to it.

This constructor assumes that the entire JSON payload is contained in jsonData; it is equivalent to Utf8JsonReader.IsFinalBlock = true.

Applies to

Utf8JsonReader(ReadOnlySequence<Byte>, Boolean, JsonReaderState)

Initializes a new instance of the Utf8JsonReader structure that processes a read-only sequence of UTF-8 encoded text and indicates whether the input contains all the text to process.

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)

Parameters

jsonData
ReadOnlySequence<Byte>

The UTF-8 encoded JSON text to process.

isFinalBlock
Boolean

true to indicate that the input sequence contains the entire data to process; false to indicate that the input span contains partial data with more data to follow.

state
JsonReaderState

An object that contains the reader state. If this is the first call to the constructor, pass the default state; otherwise, pass the value of the CurrentState property from the previous instance of the Utf8JsonReader.

Remarks

Since this type is a ref struct, it is a stack-only type, and all the limitations of ref structs apply to it. This is the reason why the constructor accepts a JsonReaderState.

Applies to

Utf8JsonReader(ReadOnlySpan<Byte>, Boolean, JsonReaderState)

Initializes a new instance of the Utf8JsonReader structure that processes a read-only span of UTF-8 encoded text and indicates whether the input contains all the text to process.

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)

Parameters

jsonData
ReadOnlySpan<Byte>

The UTF-8 encoded JSON text to process.

isFinalBlock
Boolean

true to indicate that the input sequence contains the entire data to process; false to indicate that the input span contains partial data with more data to follow.

state
JsonReaderState

An object that contains the reader state. If this is the first call to the constructor, pass the default state; otherwise, pass the value of the CurrentState property from the previous instance of the Utf8JsonReader.

Remarks

Since this type is a ref struct, it is a stack-only type, and all the limitations of ref structs apply to it. This is the reason why the constructor accepts a JsonReaderState.

Applies to