Reads count characters from the current stream, returns the data in 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] Overridable Public Function ReadChars( _ ByVal count As Integer _ ) As Char () [C#] public virtual char[] ReadChars( int count ); [C++] public: virtual __wchar_t* ReadChars( int count ) []; [JScript] public function ReadChars( count : int ) : Char[];
A character array containing data read from the underlying stream. This may be less than the number of characters requested if the end of the stream is reached.
Exception Type | Condition |
---|---|
EndOfStreamException | The end of the stream has been reached. |
IOException | An I/O error occurs. |
ArgumentOutOfRangeException | count is negative. |
BinaryReader Class | BinaryReader Members | System.IO Namespace