Mono Class Library: System.IO.StreamWriter Overview | Members

System.IO.StreamWriter.Write Method

Writes a sub-array of characters to the underlying stream. [Edit]

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

Parameters

buffer
A char array containing the data to write. [Edit]
index
A int that specifies the index into buffer at which to begin writing. [Edit]
count
A int that specifies the number of characters to read from buffer. [Edit]

Exceptions

TypeReason
ArgumentNullExceptionbuffer is null. [Edit]
ArgumentExceptionbuffer.Length - index < count. [Edit]
ArgumentOutOfRangeExceptionindex or count is negative. [Edit]
ObjectDisposedExceptionThe current writer is closed. [Edit]
NotSupportedExceptionStreamWriter.AutoFlush is true or the System.IO.StreamWriter buffer is full, and the contents of the buffer cannot be written to the underlying fixed size stream because the System.IO.StreamWriter is at the end the stream. [Edit]
System.IO.IOExceptionAn I/O error occurred. [Edit]

Remarks

The specified characters are written to the underlying stream unless the end of the stream is reached prematurely.

If StreamWriter.AutoFlush is true, StreamWriter.Flush is invoked automatically.

Note: This method overrides TextWriter.Write(char).

[Edit]

Requirements

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