Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
- buffer
- A byte array. When this method returns, the elements between offset and (offset + count - 1) are replaced by the bytes read from the current source.
- offset
- A int that specifies the zero based byte offset in buffer at which to begin storing the data read from the current stream.
- count
- A int that specifies the maximum number of bytes to be read from the current stream.
A int that specifies the total number of bytes read into the buffer, or zero if the end of the stream has been reached before any data can be read.
Type Reason ArgumentException (offset + count - 1) is greater than the length of buffer. ArgumentNullException buffer is null. ArgumentOutOfRangeException offset or count is less than zero. System.IO.IOException An I/O error occurred. NotSupportedException The current stream does not support reading. ObjectDisposedException The stream is closed.
Note: Use the Stream.CanRead property to determine whether the current instance supports reading.Operation
As described above.
Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0