Reads count bytes from the current stream into a byte array, and advances the current position by count bytes.
[Visual Basic] Overridable Public Function ReadBytes( _ ByVal count As Integer _ ) As Byte () [C#] public virtual byte[] ReadBytes( int count ); [C++] public: virtual unsigned char* ReadBytes( int count ) []; [JScript] public function ReadBytes( count : int ) : Byte[];
A byte array containing data read from the underlying stream. This may be less than the number of bytes 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