Skip to content

Utf8JsonWriter Constructors

Definition

Namespace: Corvus.Text.Json
Assembly: Corvus.Text.Json.dll

Overloads

Constructor Description
Utf8JsonWriter(IBufferWriter<byte>, JsonWriterOptions) Constructs a new Utf8JsonWriter instance with a specified bufferWriter.
Utf8JsonWriter(Stream, JsonWriterOptions) Constructs a new Utf8JsonWriter instance with a specified utf8Json.

Utf8JsonWriter(IBufferWriter<byte>, JsonWriterOptions)

Source: Utf8JsonWriter.cs

Constructs a new Utf8JsonWriter instance with a specified bufferWriter.

public Utf8JsonWriter(IBufferWriter<byte> bufferWriter, JsonWriterOptions options)

Parameters

Name Type Description
bufferWriter IBufferWriter<byte> An instance of IBufferWriter used as a destination for writing JSON text into.
options JsonWriterOptions Defines the customized behavior of the Utf8JsonWriter By default, the Utf8JsonWriter writes JSON minimized (that is, with no extra whitespace) and validates that the JSON being written is structurally valid according to JSON RFC. (optional)

Exceptions

Exception Description
ArgumentNullException Thrown when the instance of IBufferWriter that is passed in is null.

Applies To

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

Utf8JsonWriter(Stream, JsonWriterOptions)

Source: Utf8JsonWriter.cs

Constructs a new Utf8JsonWriter instance with a specified utf8Json.

public Utf8JsonWriter(Stream utf8Json, JsonWriterOptions options)

Parameters

Name Type Description
utf8Json Stream An instance of Stream used as a destination for writing JSON text into.
options JsonWriterOptions Defines the customized behavior of the Utf8JsonWriter By default, the Utf8JsonWriter writes JSON minimized (that is, with no extra whitespace) and validates that the JSON being written is structurally valid according to JSON RFC. (optional)

Exceptions

Exception Description
ArgumentNullException Thrown when the instance of Stream that is passed in is null.

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