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!

StreamReader Constructor (Stream, Encoding, Int32)

Creates a new instance of the StreamReader class for the specified stream, with the specified character encoding and buffer size.

[Visual Basic]
Overloads Public Sub New( _
   ByVal stream As Stream, _
   ByVal encoding As Encoding, _
   ByVal bufferSize As Integer _
)
[C#]
public StreamReader(
   Stream stream,
   Encoding encoding,
   int bufferSize
);
[C++]
public: StreamReader(
   Stream* stream,
   Encoding* encoding,
   int bufferSize
);
[JScript]
public function StreamReader(
   stream : Stream,
   encoding : Encoding,
   bufferSize : int
);

Parameters

stream
The stream to be read.
encoding
The character encoding to use.
bufferSize
The suggested minimum buffer size.

Exceptions

Exception Type Condition
ArgumentException stream does not support reading.
ArgumentNullException stream or encoding is null.
ArgumentOutOfRangeException bufferSize is less than or equal to zero.

Remarks

The character encoding is set by encoding. The buffer size, in number of 16-bit characters, is set by bufferSize. If bufferSize is less than the minimum allowable size (128 characters), the minimum allowable size is used.

See Also

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