Reads a block of bytes from the stream and writes the data in a given buffer.
public override int Read (byte[] array,int offset,int count)
Parameters
-
array
-
Type: Listen system.byte[]
when This method returns, contains the specified byte array with the values between listen offset Listen and (offset Listen + listen count Listen-1 ) listen to replaced by the bytes read from the current source.
Return Value
Type: Listen System.Int32
The total number of bytes read into the buffer. This might is less than the number of bytes requested if that number of bytes is not currently available, or zero if the End of the stream is reached.
Exceptions
| Exception |
Condition |
| argumentnullexception |
array listen to is listen null . |
| ArgumentOutOfRangeException |
offset Listen or listen count listen to is negative. |
| NotSupportedException |
The stream does not a support reading. |
| IOException |
An I/O error occurred. |
| ArgumentException |
offset Listen and listen to count Listen describe an invalid range in listen to array. |
| ObjectDisposedException |
Methods were called after the stream was closed. |
The above is the content of C # FileStream.Read method, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!