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 (String, Encoding, Int32)

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

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

Parameters

path
The complete file path to be read.
encoding
The character encoding to use.
bufferSize
The suggested minimum buffer size.

Exceptions

Exception Type Condition
ArgumentException path is an empty string.
ArgumentNullException path or encoding is null.
ArgumentOutOfRangeException bufferSize is less than zero.
FileNotFoundException The file cannot be found.

Remarks

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