BinaryReader.ReadBytes Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Reads the specified number of bytes from the current stream into a byte array and advances the current position by that number of bytes.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- count
- Type: System.Int32
The number of bytes to read.
Return Value
Type: System.Byte []A byte array containing data read from the underlying stream. This might be less than the number of bytes requested if the end of the stream is reached.
| Exception | Condition |
|---|---|
| IOException | An I/O error occurs. |
| ObjectDisposedException | The stream is closed. |
| ArgumentOutOfRangeException | count is negative. |
BinaryReader does not restore the file position after an unsuccessful read operation.
Show: