Creates a new instance of the StreamWriter class for the specified stream, using the specified encoding and buffer size.
[Visual Basic] Overloads Public Sub New( _ ByVal stream As Stream, _ ByVal encoding As Encoding, _ ByVal bufferSize As Integer _ ) [C#] public StreamWriter( Stream stream, Encoding encoding, int bufferSize ); [C++] public: StreamWriter( Stream* stream, Encoding* encoding, int bufferSize ); [JScript] public function StreamWriter( stream : Stream, encoding : Encoding, bufferSize : int );
Exception Type | Condition |
---|---|
ArgumentNullException | stream or encoding is a null reference (in Visual Basic Nothing). |
ArgumentOutOfRangeException | bufferSize is negative. |
ArgumentException | stream does not support writing. |
StreamWriter Class | StreamWriter Members | System.IO Namespace | StreamWriter Constructor Overload List