JsonDocument.Parse JsonDocument.Parse JsonDocument.Parse Method

Definition

Overloads

Parse(ReadOnlySequence<Byte>, JsonDocumentOptions) Parse(ReadOnlySequence<Byte>, JsonDocumentOptions) Parse(ReadOnlySequence<Byte>, JsonDocumentOptions)

Parses a sequence as UTF-8-encoded text representing a single JSON byte value into a JsonDocument.

Parse(Stream, JsonDocumentOptions) Parse(Stream, JsonDocumentOptions) Parse(Stream, JsonDocumentOptions)

Parses a Stream as UTF-8-encoded data representing a single JSON value into a JsonDocument. The stream is read to completion.

Parse(ReadOnlyMemory<Byte>, JsonDocumentOptions) Parse(ReadOnlyMemory<Byte>, JsonDocumentOptions) Parse(ReadOnlyMemory<Byte>, JsonDocumentOptions)

Parses memory as UTF-8-encoded text representing a single JSON byte value into a JsonDocument.

Parse(ReadOnlyMemory<Char>, JsonDocumentOptions) Parse(ReadOnlyMemory<Char>, JsonDocumentOptions) Parse(ReadOnlyMemory<Char>, JsonDocumentOptions)

Parses text representing a single JSON character value into a JsonDocument.

Parse(String, JsonDocumentOptions) Parse(String, JsonDocumentOptions) Parse(String, JsonDocumentOptions)

Parses text representing a single JSON string value into a JsonDocument.

Parse(ReadOnlySequence<Byte>, JsonDocumentOptions) Parse(ReadOnlySequence<Byte>, JsonDocumentOptions) Parse(ReadOnlySequence<Byte>, JsonDocumentOptions)

Parses a sequence as UTF-8-encoded text representing a single JSON byte value into a JsonDocument.

public static System.Text.Json.JsonDocument Parse (System.Buffers.ReadOnlySequence<byte> utf8Json, System.Text.Json.JsonDocumentOptions options = null);
static member Parse : System.Buffers.ReadOnlySequence<byte> * System.Text.Json.JsonDocumentOptions -> System.Text.Json.JsonDocument
Public Shared Function Parse (utf8Json As ReadOnlySequence(Of Byte), Optional options As JsonDocumentOptions = null) As JsonDocument

Parameters

utf8Json
ReadOnlySequence<Byte>

The JSON text to parse.

options
JsonDocumentOptions JsonDocumentOptions JsonDocumentOptions

Options to control the reader behavior during parsing.

Returns

A JsonDocument representation of the JSON value.

Exceptions

utf8Json does not represent a valid single JSON value.

readerOptions contains unsupported options.

Remarks

The ReadOnlySequence<T> may be used for the entire lifetime of the JsonDocument object, and the caller must ensure that the data therein does not change during the object lifetime. Because the input is considered to be text, a UTF-8 Byte-Order-Mark (BOM) must not be present.

Parse(Stream, JsonDocumentOptions) Parse(Stream, JsonDocumentOptions) Parse(Stream, JsonDocumentOptions)

Parses a Stream as UTF-8-encoded data representing a single JSON value into a JsonDocument. The stream is read to completion.

public static System.Text.Json.JsonDocument Parse (System.IO.Stream utf8Json, System.Text.Json.JsonDocumentOptions options = null);
static member Parse : System.IO.Stream * System.Text.Json.JsonDocumentOptions -> System.Text.Json.JsonDocument
Public Shared Function Parse (utf8Json As Stream, Optional options As JsonDocumentOptions = null) As JsonDocument

Parameters

utf8Json
Stream Stream Stream

The JSON data to parse.

options
JsonDocumentOptions JsonDocumentOptions JsonDocumentOptions

Options to control the reader behavior during parsing.

Returns

A JsonDocument representation of the JSON value.

Exceptions

utf8Json does not represent a valid single JSON value.

readerOptions contains unsupported options.

Parse(ReadOnlyMemory<Byte>, JsonDocumentOptions) Parse(ReadOnlyMemory<Byte>, JsonDocumentOptions) Parse(ReadOnlyMemory<Byte>, JsonDocumentOptions)

Parses memory as UTF-8-encoded text representing a single JSON byte value into a JsonDocument.

public static System.Text.Json.JsonDocument Parse (ReadOnlyMemory<byte> utf8Json, System.Text.Json.JsonDocumentOptions options = null);
static member Parse : ReadOnlyMemory<byte> * System.Text.Json.JsonDocumentOptions -> System.Text.Json.JsonDocument
Public Shared Function Parse (utf8Json As ReadOnlyMemory(Of Byte), Optional options As JsonDocumentOptions = null) As JsonDocument

Parameters

utf8Json
ReadOnlyMemory<Byte>

The JSON text to parse.

options
JsonDocumentOptions JsonDocumentOptions JsonDocumentOptions

Options to control the reader behavior during parsing.

Returns

A JsonDocument representation of the JSON value.

Exceptions

utf8Json does not represent a valid single JSON value.

readerOptions contains unsupported options.

Remarks

The ReadOnlyMemory<T> value will be used for the entire lifetime of the JsonDocument object, and the caller must ensure that the data therein does not change during the object lifetime.

Because the input is considered to be text, a UTF-8 Byte-Order-Mark (BOM) must not be present.

Parse(ReadOnlyMemory<Char>, JsonDocumentOptions) Parse(ReadOnlyMemory<Char>, JsonDocumentOptions) Parse(ReadOnlyMemory<Char>, JsonDocumentOptions)

Parses text representing a single JSON character value into a JsonDocument.

public static System.Text.Json.JsonDocument Parse (ReadOnlyMemory<char> json, System.Text.Json.JsonDocumentOptions options = null);
static member Parse : ReadOnlyMemory<char> * System.Text.Json.JsonDocumentOptions -> System.Text.Json.JsonDocument
Public Shared Function Parse (json As ReadOnlyMemory(Of Char), Optional options As JsonDocumentOptions = null) As JsonDocument

Parameters

json
ReadOnlyMemory<Char>

The JSON text to parse.

options
JsonDocumentOptions JsonDocumentOptions JsonDocumentOptions

Options to control the reader behavior during parsing.

Returns

A JsonDocument representation of the JSON value.

Exceptions

json does not represent a valid single JSON value.

readerOptions contains unsupported options.

Remarks

The ReadOnlyMemory<T> value may be used for the entire lifetime of the JsonDocument object, and the caller must ensure that the data therein does not change during the object lifetime.

Parse(String, JsonDocumentOptions) Parse(String, JsonDocumentOptions) Parse(String, JsonDocumentOptions)

Parses text representing a single JSON string value into a JsonDocument.

public static System.Text.Json.JsonDocument Parse (string json, System.Text.Json.JsonDocumentOptions options = null);
static member Parse : string * System.Text.Json.JsonDocumentOptions -> System.Text.Json.JsonDocument
Public Shared Function Parse (json As String, Optional options As JsonDocumentOptions = null) As JsonDocument

Parameters

json
String String String

The JSON text to parse.

options
JsonDocumentOptions JsonDocumentOptions JsonDocumentOptions

Options to control the reader behavior during parsing.

Returns

A JsonDocument representation of the JSON value.

Exceptions

json does not represent a valid single JSON value.

readerOptions contains unsupported options.

Applies to