System.IO.StreamWriter.Write Method

Writes a character to the stream.

Syntax

public override void Write (char value)

Parameters

value
The character to write to the stream.

Exceptions

TypeReason
ObjectDisposedExceptionThe current writer is closed.
NotSupportedException StreamWriter.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.
System.IO.IOException An I/O error occurred.

Remarks

This method overrides TextWriter.Write(char).

The specified character is written to the underlying stream unless the end of the stream is reached prematurely. If StreamWriter.AutoFlush is true, StreamWriter.Flush is invoked automatically.

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