Utf8JsonReader Constructors
Definition
Namespace: Corvus.Text.Json
Assembly: Corvus.Text.Json.dll
Overloads
| Constructor | Description |
|---|---|
| Utf8JsonReader(ReadOnlySpan<byte>, bool, JsonReaderState) | Constructs a new Utf8JsonReader instance. |
| Utf8JsonReader(ReadOnlySpan<byte>, JsonReaderOptions) | Constructs a new Utf8JsonReader instance. |
| Utf8JsonReader(ReadOnlySequence<byte>, bool, JsonReaderState) | Constructs a new Utf8JsonReader instance. |
| Utf8JsonReader(ReadOnlySequence<byte>, JsonReaderOptions) | Constructs a new Utf8JsonReader instance. |
Utf8JsonReader(ReadOnlySpan<byte>, bool, JsonReaderState)
Source: Utf8JsonReader.cs
Constructs a new Utf8JsonReader instance.
public Utf8JsonReader(ReadOnlySpan<byte> jsonData, bool isFinalBlock, JsonReaderState state)
Parameters
| Name | Type | Description |
|---|---|---|
jsonData |
ReadOnlySpan<byte> |
The ReadOnlySpan |
isFinalBlock |
bool |
True when the input span contains the entire data to process. Set to false only if it is known that the input span contains partial data with more data to follow. |
state |
JsonReaderState |
If this is the first call to the ctor, pass in a default state. Otherwise, capture the state from the previous instance of the Utf8JsonReader and pass that back. |
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 ctor accepts a JsonReaderState.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
Utf8JsonReader(ReadOnlySpan<byte>, JsonReaderOptions)
Source: Utf8JsonReader.cs
Constructs a new Utf8JsonReader instance.
public Utf8JsonReader(ReadOnlySpan<byte> jsonData, JsonReaderOptions options)
Parameters
| Name | Type | Description |
|---|---|---|
jsonData |
ReadOnlySpan<byte> |
The ReadOnlySpan |
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
Since this type is a ref struct, it is a stack-only type and all the limitations of ref structs apply to it. This assumes that the entire JSON payload is passed in (equivalent to IsFinalBlock= true)
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
Utf8JsonReader(ReadOnlySequence<byte>, bool, JsonReaderState)
Source: Utf8JsonReader.MultiSegment.cs
Constructs a new Utf8JsonReader instance.
public Utf8JsonReader(ReadOnlySequence<byte> jsonData, bool isFinalBlock, JsonReaderState state)
Parameters
| Name | Type | Description |
|---|---|---|
jsonData |
ReadOnlySequence<byte> |
The ReadOnlySequence |
isFinalBlock |
bool |
True when the input span contains the entire data to process. Set to false only if it is known that the input span contains partial data with more data to follow. |
state |
JsonReaderState |
If this is the first call to the ctor, pass in a default state. Otherwise, capture the state from the previous instance of the Utf8JsonReader and pass that back. |
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 ctor accepts a JsonReaderState.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
Utf8JsonReader(ReadOnlySequence<byte>, JsonReaderOptions)
Source: Utf8JsonReader.MultiSegment.cs
Constructs a new Utf8JsonReader instance.
public Utf8JsonReader(ReadOnlySequence<byte> jsonData, JsonReaderOptions options)
Parameters
| Name | Type | Description |
|---|---|---|
jsonData |
ReadOnlySequence<byte> |
The ReadOnlySequence |
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
Since this type is a ref struct, it is a stack-only type and all the limitations of ref structs apply to it. This assumes that the entire JSON payload is passed in (equivalent to IsFinalBlock= true)
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