System.IO.TextWriter.Write Method

Writes a subarray of characters to the text string or stream.

Syntax

public virtual void Write (char[] buffer, int index, int count)

Parameters

buffer
The character array to write data from.
index
The character position in the buffer at which to start retrieving data.
count
The number of characters to write.

Exceptions

TypeReason
ArgumentNullException buffer is null.
ArgumentException(index + count ) > buffer.Length.
ArgumentOutOfRangeException index < 0 or count < 0.
System.IO.IOExceptionAn I/O error occurred.

Remarks

This method will write count characters of data into this TextWriter from the buffer character array starting at position index.

This overload is equivalent to the TextWriter.Write(Char[]) overload for each character in buffer between index and (index + count).

For a list of common I/O tasks, see Common I/O Tasks.

Requirements

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