Reads a maximum of count characters from the current stream and writes the data to buffer, beginning at index.
[Visual Basic] Overridable Public Function ReadBlock( _ ByVal buffer() As Char, _ ByVal index As Integer, _ ByVal count As Integer _ ) As Integer [C#] public virtual int ReadBlock( char[] buffer, int index, int count ); [C++] public: virtual int ReadBlock( __wchar_t* buffer[], int index, int count ); [JScript] public function ReadBlock( 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 EOF character is encountered.
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. |
The method blocks until either count characters are read, or the end of the file is reached. This is a blocking version of Read.