Επεξεργασία

Κοινή χρήση μέσω


Utf8JsonWriter.WriteRawValue Method

Definition

Overloads

WriteRawValue(ReadOnlySequence<Byte>, Boolean)

Writes the input as JSON content. It is expected that the input content is a single complete JSON value.

WriteRawValue(ReadOnlySpan<Char>, Boolean)

Writes the input as JSON content. It is expected that the input content is a single complete JSON value.

WriteRawValue(String, Boolean)

Writes the input as JSON content. It is expected that the input content is a single complete JSON value.

WriteRawValue(ReadOnlySpan<Byte>, Boolean)

Writes the input as JSON content. It is expected that the input content is a single complete JSON value.

WriteRawValue(ReadOnlySequence<Byte>, Boolean)

Source:
Utf8JsonWriter.WriteValues.Raw.cs
Source:
Utf8JsonWriter.WriteValues.Raw.cs
Source:
Utf8JsonWriter.WriteValues.Raw.cs
Source:
Utf8JsonWriter.WriteValues.Raw.cs

Writes the input as JSON content. It is expected that the input content is a single complete JSON value.

public void WriteRawValue (System.Buffers.ReadOnlySequence<byte> utf8Json, bool skipInputValidation = false);
member this.WriteRawValue : System.Buffers.ReadOnlySequence<byte> * bool -> unit
Public Sub WriteRawValue (utf8Json As ReadOnlySequence(Of Byte), Optional skipInputValidation As Boolean = false)

Parameters

utf8Json
ReadOnlySequence<Byte>

The raw JSON content to write.

skipInputValidation
Boolean

false to validate if the input is an RFC 8259-compliant JSON payload; true to skip validation.

Exceptions

The length of the input is zero or equal to Int32.MaxValue.

skipInputValidation is false, and the input is not a valid, complete, single JSON value according to the JSON RFC or the input JSON exceeds a recursive depth of 64.

Remarks

When writing untrusted JSON values, don't set skipInputValidation to true as this can result in invalid JSON being written or an invalid overall payload being written to the writer instance.

When using this method, the input content will be written to the writer destination as-is, unless validation fails (when it is enabled).

The SkipValidation value for the writer instance is honored when using this method.

The Indented and Encoder values for the writer instance are not applied when using this method.

Applies to

WriteRawValue(ReadOnlySpan<Char>, Boolean)

Source:
Utf8JsonWriter.WriteValues.Raw.cs
Source:
Utf8JsonWriter.WriteValues.Raw.cs
Source:
Utf8JsonWriter.WriteValues.Raw.cs
Source:
Utf8JsonWriter.WriteValues.Raw.cs
Source:
Utf8JsonWriter.WriteValues.Raw.cs

Writes the input as JSON content. It is expected that the input content is a single complete JSON value.

public void WriteRawValue (ReadOnlySpan<char> json, bool skipInputValidation = false);
member this.WriteRawValue : ReadOnlySpan<char> * bool -> unit
Public Sub WriteRawValue (json As ReadOnlySpan(Of Char), Optional skipInputValidation As Boolean = false)

Parameters

json
ReadOnlySpan<Char>

The raw JSON content to write.

skipInputValidation
Boolean

false to validate if the input is an RFC 8259-compliant JSON payload; true otherwise.

Exceptions

The length of the input is zero or greater than 715,827,882 (Int32.MaxValue / 3).

skipInputValidation is false, and the input is not a valid, complete, single JSON value according to the JSON RFC, or the input JSON exceeds a recursive depth of 64.

Remarks

When writing untrusted JSON values, do not set skipInputValidation to true as this can result in invalid JSON being written, or an invalid overall payload being written to the writer instance.

When using this method, the input content will be written to the writer destination as-is, unless validation fails (when it is enabled).

The SkipValidation value for the writer instance is honored when using this method.

The Indented and Encoder values for the writer instance are not applied when using this method.

Applies to

WriteRawValue(String, Boolean)

Source:
Utf8JsonWriter.WriteValues.Raw.cs
Source:
Utf8JsonWriter.WriteValues.Raw.cs
Source:
Utf8JsonWriter.WriteValues.Raw.cs
Source:
Utf8JsonWriter.WriteValues.Raw.cs
Source:
Utf8JsonWriter.WriteValues.Raw.cs

Writes the input as JSON content. It is expected that the input content is a single complete JSON value.

public void WriteRawValue (string json, bool skipInputValidation = false);
member this.WriteRawValue : string * bool -> unit
Public Sub WriteRawValue (json As String, Optional skipInputValidation As Boolean = false)

Parameters

json
String

The raw JSON content to write.

skipInputValidation
Boolean

false to validate if the input is an RFC 8259-compliant JSON payload; true otherwise.

Exceptions

json is null.

The length of the input is zero or greater than 715,827,882 (Int32.MaxValue / 3).

skipInputValidation is false, and the input is not a valid, complete, single JSON value according to the JSON RFC, or the input JSON exceeds a recursive depth of 64.

Remarks

When writing untrusted JSON values, do not set skipInputValidation to true as this can result in invalid JSON being written, or an invalid overall payload being written to the writer instance.

When using this method, the input content will be written to the writer destination as-is, unless validation fails (when it is enabled).

The SkipValidation value for the writer instance is honored when using this method.

The Indented and Encoder values for the writer instance are not applied when using this method.

Applies to

WriteRawValue(ReadOnlySpan<Byte>, Boolean)

Source:
Utf8JsonWriter.WriteValues.Raw.cs
Source:
Utf8JsonWriter.WriteValues.Raw.cs
Source:
Utf8JsonWriter.WriteValues.Raw.cs
Source:
Utf8JsonWriter.WriteValues.Raw.cs
Source:
Utf8JsonWriter.WriteValues.Raw.cs

Writes the input as JSON content. It is expected that the input content is a single complete JSON value.

public void WriteRawValue (ReadOnlySpan<byte> utf8Json, bool skipInputValidation = false);
member this.WriteRawValue : ReadOnlySpan<byte> * bool -> unit
Public Sub WriteRawValue (utf8Json As ReadOnlySpan(Of Byte), Optional skipInputValidation As Boolean = false)

Parameters

utf8Json
ReadOnlySpan<Byte>

The raw JSON content to write.

skipInputValidation
Boolean

false to validate if the input is an RFC 8259-compliant JSON payload; true otherwise.

Exceptions

The length of the input is zero or equal to Int32.MaxValue.

skipInputValidation is false, and the input is not a valid, complete, single JSON value according to the JSON RFC, or the input JSON exceeds a recursive depth of 64.

Remarks

When writing untrusted JSON values, do not set skipInputValidation to true as this can result in invalid JSON being written, or an invalid overall payload being written to the writer.

When using this method, the input content will be written to the writer destination as-is, unless validation fails (when it is enabled).

The SkipValidation value for the writer instance is honored when using this method.

The Indented and Encoder values for the writer instance are not applied when using this method.

Applies to