System.IO.TextWriter Class

Represents a writer that can write a sequential series of characters. This class is abstract.

See Also: TextWriter Members

Syntax

[System.Runtime.InteropServices.ComVisible(true)]
public abstract class TextWriter : MarshalByRefObject, IDisposable

Remarks

System.IO.TextWriter is the abstract base class of System.IO.StreamWriter and System.IO.StringWriter, which write characters to streams and strings, respectively. Create an instance of System.IO.TextWriter to write an object to a string, write strings to a file, or to serialize XML. You can also use an instance of System.IO.TextWriter to write text to a custom backing store using the same APIs you would use for a string or a stream, or to add support for text formatting.

All the Write methods of System.IO.TextWriter having primitive data types as parameters write out the values as strings.

By default, a System.IO.TextWriter is not thread safe. See TextWriter.Synchronized(TextWriter) for a thread-safe wrapper.

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

Thread Safety

All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.

Requirements

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