Creates a new instance of the StreamReader class for the specified stream and with the specified character encoding.
[Visual Basic] Overloads Public Sub New( _ ByVal stream As Stream, _ ByVal encoding As Encoding _ ) [C#] public StreamReader( Stream stream, Encoding encoding ); [C++] public: StreamReader( Stream* stream, Encoding* encoding ); [JScript] public function StreamReader( stream : Stream, encoding : Encoding );
Exception Type | Condition |
---|---|
ArgumentException | stream does not support reading. |
ArgumentNullException | stream or encoding is null. |
The character encoding is set by encoding, and the default buffer size is used.
StreamReader Class | StreamReader Members | System.IO Namespace | StreamReader Constructor Overload List