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

System.IO.StreamWriter Constructor

Constructs and initializes a new instance of the System.IO.StreamWriter class for the specified stream, using the default encoding and buffer size. [Edit]

public StreamWriter (Stream stream)

Parameters

stream
The System.IO.Stream to write to. [Edit]

Exceptions

TypeReason
ArgumentExceptionstream does not support writing. [Edit]
ArgumentNullExceptionstream is null. [Edit]

Remarks

This constructor initializes the StreamWriter.Encoding property to a System.Text.UTF8Encoding whose System.Text.Encoding.GetPreamble method returns an empty byte array. For additional information, see TextWriter.Encoding . The StreamWriter.BaseStream property is initialized using stream .

Note: The default buffer size can typically be around 4 KB.

[Edit]

Requirements

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