Reads a block of characters from the current stream into a character array and advances the current position in accordance with the Encoding used and perhaps the particular character being read from the stream.
[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 total number of characters read into the buffer. This may be less than the number of characters requested if that many characters are not currently available, or it may be zero if the end of the stream is reached.
Exception Type | Condition |
---|---|
ArgumentException | The buffer length minus index is less than count. |
ArgumentNullException | buffer is a null reference (in Visual Basic Nothing). |
ArgumentOutOfRangeException | index or count is negative. |
IOException | The stream is a null reference (Nothing) or closed. |
BinaryReader Class | BinaryReader Members | System.IO Namespace | BinaryReader.Read Overload List