Skip to content

JsonReaderState Constructors

Definition

Namespace: Corvus.Text.Json
Assembly: Corvus.Text.Json.dll
Source: JsonReaderState.cs

JsonReaderState(JsonReaderOptions)

Constructs a new JsonReaderState instance.

public JsonReaderState(JsonReaderOptions options)

Parameters

Name Type Description
options JsonReaderOptions Defines the customized behavior of the Utf8JsonReader that is different 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 (i.e. comments within the JSON are invalid) and reads up to a maximum depth of 64. (optional)

Remarks

An instance of this state must be passed to the Utf8JsonReader ctor with the JSON data. Unlike the Utf8JsonReader, which is a ref struct, the state can survive across async/await boundaries and hence this type is required to provide support for reading in more data asynchronously before continuing with a new instance of the Utf8JsonReader.

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests.

Open an issue