Utf8JsonWriter.WriteStartArray Method

Definition

Overloads

WriteStartArray()

Writes the beginning of a JSON array.

WriteStartArray(ReadOnlySpan<Byte>)

Writes the beginning of a JSON array with a property name specified as a read-only span of bytes as the key.

WriteStartArray(ReadOnlySpan<Char>)

Writes the beginning of a JSON array with a property name specified as a read-only character span as the key.

WriteStartArray(String)

Writes the beginning of a JSON array with a property name specified as a string as the key.

WriteStartArray(JsonEncodedText)

Writes the beginning of a JSON array with a pre-encoded property name as the key.

WriteStartArray()

Writes the beginning of a JSON array.

public:
 void WriteStartArray();
public void WriteStartArray ();
member this.WriteStartArray : unit -> unit
Public Sub WriteStartArray ()

Exceptions

The depth of the JSON exceeds the maximum depth of 1,000.

-or-

Validation is enabled, and this write operation would produce invalid JSON.

Applies to

WriteStartArray(ReadOnlySpan<Byte>)

Writes the beginning of a JSON array with a property name specified as a read-only span of bytes as the key.

public:
 void WriteStartArray(ReadOnlySpan<System::Byte> utf8PropertyName);
public void WriteStartArray (ReadOnlySpan<byte> utf8PropertyName);
member this.WriteStartArray : ReadOnlySpan<byte> -> unit
Public Sub WriteStartArray (utf8PropertyName As ReadOnlySpan(Of Byte))

Parameters

utf8PropertyName
ReadOnlySpan<Byte>

The UTF-8 encoded property name of the JSON array to be written.

Exceptions

The specified property name is too large.

The depth of the JSON exceeds the maximum depth of 1,000.

-or-

Validation is enabled, and this write operation would produce invalid JSON.

Remarks

The property name is escaped before writing.

Applies to

WriteStartArray(ReadOnlySpan<Char>)

Writes the beginning of a JSON array with a property name specified as a read-only character span as the key.

public:
 void WriteStartArray(ReadOnlySpan<char> propertyName);
public void WriteStartArray (ReadOnlySpan<char> propertyName);
member this.WriteStartArray : ReadOnlySpan<char> -> unit
Public Sub WriteStartArray (propertyName As ReadOnlySpan(Of Char))

Parameters

propertyName
ReadOnlySpan<Char>

The UTF-16 encoded property name of the JSON array to be transcoded and written as UTF-8.

Exceptions

The specified property name is too large.

The depth of the JSON exceeds the maximum depth of 1,000.

-or-

Validation is enabled, and this write operation would produce invalid JSON.

Remarks

The property name is escaped before writing.

Applies to

WriteStartArray(String)

Writes the beginning of a JSON array with a property name specified as a string as the key.

public:
 void WriteStartArray(System::String ^ propertyName);
public void WriteStartArray (string propertyName);
member this.WriteStartArray : string -> unit
Public Sub WriteStartArray (propertyName As String)

Parameters

propertyName
String

The UTF-16 encoded property name of the JSON array to be transcoded and written as UTF-8.

Exceptions

The specified property name is too large.

The depth of the JSON exceeds the maximum depth of 1,000.

-or-

Validation is enabled, and this write operation would produce invalid JSON.

The propertyName parameter is null.

Remarks

The property name is escaped before writing.

Applies to

WriteStartArray(JsonEncodedText)

Writes the beginning of a JSON array with a pre-encoded property name as the key.

public:
 void WriteStartArray(System::Text::Json::JsonEncodedText propertyName);
public void WriteStartArray (System.Text.Json.JsonEncodedText propertyName);
member this.WriteStartArray : System.Text.Json.JsonEncodedText -> unit
Public Sub WriteStartArray (propertyName As JsonEncodedText)

Parameters

propertyName
JsonEncodedText

The JSON encoded property name of the JSON array to be transcoded and written as UTF-8.

Exceptions

The depth of the JSON has exceeded the maximum depth of 1,000.

-or-

Validation is enabled, and this method would result in writing invalid JSON.

Remarks

The property name should already be escaped when the instance of JsonEncodedText was created.

Applies to