Reads a block of bytes from the stream and writes the data in a given buffer.
Parameters
array Type: System.Byte
[]
offset and (offset + count - 1)
offset Type: System.Int32
array
count Type: System.Int32
The maximum number of bytes to read.
Return Value
Type:
The total number of bytes read into the buffer. This might be less than the number of bytes requested if that number of bytes are not currently available, or zero if the end of the stream is reached.
Exceptions
Exception | Condition |
array is null. | |
offset or count | |
The stream does not support reading. | |
An I/O error occurred. | |
offset and count describe an invalid range in array. | |
Methods were called after the stream was closed. |