System.Xml.XmlWriter.WriteChars Method

When overridden in a derived class, writes text one buffer at a time.

Syntax

public abstract void WriteChars (char[] buffer, int index, int count)

Parameters

buffer
Character array containing the text to write.
index
The position in the buffer indicating the start of the text to write.
count
The number of characters to write.

Exceptions

TypeReason
ArgumentNullException buffer is null.
ArgumentExceptionThe buffer length minus index is less than count.
ArgumentOutOfRangeException index or count is less than zero.
InvalidOperationExceptionThe XmlWriter.WriteState is WriteState.Closed.

Remarks

This method can be used to write large amounts of text one buffer at a time.

Special handling must be done to ensure the WriteChars method does not split surrogate pair characters across multiple buffer writes. The XML specification defines the valid ranges for surrogate pairs.

For the asynchronous version of this method, see XmlWriter.WriteCharsAsync(Char[], int, int).

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0