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