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)

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

Parameters

stream
The stream to be read.
encoding
The character encoding to use.

Exceptions

Exception Type Condition
ArgumentException stream does not support reading.
ArgumentNullException stream or encoding is null.

Remarks

The character encoding is set by encoding, and the default buffer size is used.

See Also

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