Skip to content

Utf8JsonWriter.DisposeAsync Method

Definition

Namespace: Corvus.Text.Json
Assembly: Corvus.Text.Json.dll
Source: Utf8JsonWriter.cs

DisposeAsync()

Asynchronously commits any left over JSON text that has not yet been flushed and releases all resources used by the current instance.

public ValueTask DisposeAsync()

Returns

ValueTask

Implements

IAsyncDisposable.DisposeAsync

Remarks

In the case of IBufferWriter, this advances the underlying IBufferWriter based on what has been written so far. In the case of Stream, this writes the data to the stream and flushes it. The Utf8JsonWriter instance cannot be re-used after disposing.

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