NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

StreamWriter Constructor (Stream, Encoding, Int32)

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
);

Parameters

stream
The stream to write to.
encoding
Determines which character encoding to use.
bufferSize
Sets the buffer size.

Exceptions

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.

See Also

StreamWriter Class | StreamWriter Members | System.IO Namespace | StreamWriter Constructor Overload List