Skip to content

Utf8JsonWriter.WriteBase64String Method

Definition

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

Overloads

Method Description
WriteBase64String(JsonEncodedText, ReadOnlySpan<byte>) Writes the pre-encoded property name and raw bytes value (as a Base64 encoded JSON string) as part of a name/value pair of a JSON object.
WriteBase64String(string, ReadOnlySpan<byte>) Writes the property name and raw bytes value (as a Base64 encoded JSON string) as part of a name/value pair of a JSON object.
WriteBase64String(ReadOnlySpan<char>, ReadOnlySpan<byte>) Writes the property name and raw bytes value (as a Base64 encoded JSON string) as part of a name/value pair of a JSON object.
WriteBase64String(ReadOnlySpan<byte>, ReadOnlySpan<byte>) Writes the property name and raw bytes value (as a Base64 encoded JSON string) as part of a name/value pair of a JSON object.

WriteBase64String(JsonEncodedText, ReadOnlySpan<byte>)

Source: Utf8JsonWriter.WriteProperties.Bytes.cs

Writes the pre-encoded property name and raw bytes value (as a Base64 encoded JSON string) as part of a name/value pair of a JSON object.

public void WriteBase64String(JsonEncodedText propertyName, ReadOnlySpan<byte> bytes)

Parameters

Name Type Description
propertyName JsonEncodedText The JSON-encoded name of the property to write.
bytes ReadOnlySpan<byte> The binary data to write as Base64 encoded text.

Exceptions

Exception Description
InvalidOperationException Thrown if this would result in invalid JSON being written (while validation is enabled).

Applies To

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

WriteBase64String(string, ReadOnlySpan<byte>)

Source: Utf8JsonWriter.WriteProperties.Bytes.cs

Writes the property name and raw bytes value (as a Base64 encoded JSON string) as part of a name/value pair of a JSON object.

public void WriteBase64String(string propertyName, ReadOnlySpan<byte> bytes)

Parameters

Name Type Description
propertyName string The name of the property to write.
bytes ReadOnlySpan<byte> The binary data to write as Base64 encoded text.

Exceptions

Exception Description
ArgumentException Thrown when the specified property name is too large.
ArgumentNullException The propertyName parameter is null.
InvalidOperationException Thrown if this would result in invalid JSON being written (while validation is enabled).

Remarks

The property name is escaped before writing.

Applies To

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

WriteBase64String(ReadOnlySpan<char>, ReadOnlySpan<byte>)

Source: Utf8JsonWriter.WriteProperties.Bytes.cs

Writes the property name and raw bytes value (as a Base64 encoded JSON string) as part of a name/value pair of a JSON object.

public void WriteBase64String(ReadOnlySpan<char> propertyName, ReadOnlySpan<byte> bytes)

Parameters

Name Type Description
propertyName ReadOnlySpan<char> The name of the property to write.
bytes ReadOnlySpan<byte> The binary data to write as Base64 encoded text.

Exceptions

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

Remarks

The property name is escaped before writing.

Applies To

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

WriteBase64String(ReadOnlySpan<byte>, ReadOnlySpan<byte>)

Source: Utf8JsonWriter.WriteProperties.Bytes.cs

Writes the property name and raw bytes value (as a Base64 encoded JSON string) as part of a name/value pair of a JSON object.

public void WriteBase64String(ReadOnlySpan<byte> utf8PropertyName, ReadOnlySpan<byte> bytes)

Parameters

Name Type Description
utf8PropertyName ReadOnlySpan<byte> The UTF-8 encoded name of the property to write.
bytes ReadOnlySpan<byte> The binary data to write as Base64 encoded text.

Exceptions

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

Remarks

The property name is escaped 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