Utf8JsonWriter.WriteCommentValue Method

Definition

Overloads

WriteCommentValue(ReadOnlySpan<Byte>)

Writes a UTF-8 text value as a JSON comment.

WriteCommentValue(ReadOnlySpan<Char>)

Writes a UTF-16 text value as a JSON comment.

WriteCommentValue(String)

Writes a string text value as a JSON comment.

WriteCommentValue(ReadOnlySpan<Byte>)

Source:
Utf8JsonWriter.WriteValues.Comment.cs
Source:
Utf8JsonWriter.WriteValues.Comment.cs
Source:
Utf8JsonWriter.WriteValues.Comment.cs
Source:
Utf8JsonWriter.WriteValues.Comment.cs
Source:
Utf8JsonWriter.WriteValues.Comment.cs

Writes a UTF-8 text value as a JSON comment.

public void WriteCommentValue (ReadOnlySpan<byte> utf8Value);

Parameters

utf8Value
ReadOnlySpan<Byte>

The UTF-8 encoded value to be written as a JSON comment within /../.

Exceptions

The specified value is too large.

-or-

utf8Value contains a comment delimiter (that is, */).

Remarks

The comment value is not escaped before writing.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

WriteCommentValue(ReadOnlySpan<Char>)

Source:
Utf8JsonWriter.WriteValues.Comment.cs
Source:
Utf8JsonWriter.WriteValues.Comment.cs
Source:
Utf8JsonWriter.WriteValues.Comment.cs
Source:
Utf8JsonWriter.WriteValues.Comment.cs
Source:
Utf8JsonWriter.WriteValues.Comment.cs

Writes a UTF-16 text value as a JSON comment.

public void WriteCommentValue (ReadOnlySpan<char> value);

Parameters

value
ReadOnlySpan<Char>

The UTF-16 encoded value to be written as a UTF-8 transcoded JSON comment within /../.

Exceptions

The specified value is too large.

-or-

value contains a comment delimiter (that is, */).

Remarks

The comment value is not escaped before writing.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

WriteCommentValue(String)

Source:
Utf8JsonWriter.WriteValues.Comment.cs
Source:
Utf8JsonWriter.WriteValues.Comment.cs
Source:
Utf8JsonWriter.WriteValues.Comment.cs
Source:
Utf8JsonWriter.WriteValues.Comment.cs
Source:
Utf8JsonWriter.WriteValues.Comment.cs

Writes a string text value as a JSON comment.

public void WriteCommentValue (string value);

Parameters

value
String

The UTF-16 encoded value to be written as a UTF-8 transcoded JSON comment within /../.

Exceptions

The specified value is too large.

-or-

value contains a comment delimiter (that is, */).

The value parameter is null.

Remarks

The comment value is not escaped before writing.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)