ComplexValueBuilder.AddItemFromJson Method
Definition
Namespace: Corvus.Text.Json.Internal
Assembly: Corvus.Text.Json.dll
Overloads
| Method | Description |
|---|---|
| AddItemFromJson(ReadOnlySpan<char>) | Parses a JSON value from the given character span and adds it as an item to the current array. |
| AddItemFromJson(ReadOnlySpan<byte>) | Parses a JSON value from the given UTF-8 byte span and adds it as an item to the current array. |
AddItemFromJson(ReadOnlySpan<char>)
Source: ComplexValueBuilder.cs
Parses a JSON value from the given character span and adds it as an item to the current array.
public void AddItemFromJson(ReadOnlySpan<char> json)
Parameters
| Name | Type | Description |
|---|---|---|
json |
ReadOnlySpan<char> |
A span of characters containing a valid JSON value. |
Exceptions
| Exception | Description |
|---|---|
JsonException |
json does not represent a valid single JSON value. |
Remarks
The parsed value is stored in a workspace-managed builder, so its lifetime is tied to the workspace. No explicit disposal is required by the caller.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
AddItemFromJson(ReadOnlySpan<byte>)
Source: ComplexValueBuilder.cs
Parses a JSON value from the given UTF-8 byte span and adds it as an item to the current array.
public void AddItemFromJson(ReadOnlySpan<byte> utf8Json)
Parameters
| Name | Type | Description |
|---|---|---|
utf8Json |
ReadOnlySpan<byte> |
A span of UTF-8 encoded bytes containing a valid JSON value. |
Exceptions
| Exception | Description |
|---|---|
JsonException |
utf8Json does not represent a valid single JSON value. |
Remarks
The parsed value is stored in a workspace-managed builder, so its lifetime is tied to the workspace. No explicit disposal is required by the caller.
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