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 );
Exception Type | Condition |
---|---|
ArgumentException | stream does not support reading. |
ArgumentNullException | stream or encoding is null. |
ArgumentOutOfRangeException | bufferSize is less than or equal to zero. |
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.
StreamReader Class | StreamReader Members | System.IO Namespace | StreamReader Constructor Overload List