Skip to content

Utf8JsonWriter.WriteBase64StringValue Method

Definition

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

WriteBase64StringValue(ReadOnlySpan<byte>)

Writes the raw bytes value as a Base64 encoded JSON string as an element of a JSON array.

public void WriteBase64StringValue(ReadOnlySpan<byte> bytes)

Parameters

Name Type Description
bytes ReadOnlySpan<byte> The binary data to write as Base64 encoded text.

Exceptions

Exception Description
ArgumentException Thrown when the specified value is too large.
InvalidOperationException Thrown if this would result in invalid JSON being written (while validation is enabled).

Remarks

The bytes are encoded before writing.

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