Reads a maximum of count characters from the current stream and writes the data to buffer, beginning at index.
[Visual Basic] Overloads Overridable Public Function Read( _ ByVal buffer() As Char, _ ByVal index As Integer, _ ByVal count As Integer _ ) As Integer [C#] public virtual int Read( char[] buffer, int index, int count ); [C++] public: virtual int Read( __wchar_t* buffer[], int index, int count ); [JScript] public function Read( buffer : Char[], index : int, count : int ) : int;
The number of characters that have been read. The number will be less than or equal to count, depending on whether the data is available within the stream.
Exception Type | Condition |
---|---|
ArgumentNullException | buffer is a null reference (in Visual Basic Nothing). |
ArgumentException | The buffer length minus index is less than count. |
ArgumentOutOfRangeException | index or count is negative. |
IOException | An I/O error occurs. |
This method returns after either count characters are read or the end of the file is reached. ReadBlock is a blocking version of this method.
TextReader Class | TextReader Members | System.IO Namespace | TextReader.Read Overload List