Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
- 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.
- A int that specifies the zero based byte offset in buffer at which to begin storing the data read from the current stream.
- 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.