Method EndRead
EndRead(IAsyncResult)
Waits for the pending asynchronous read to complete. (Consider using Read
Parameters
asyncResult
IAsyncResult The reference to the pending asynchronous request to finish.
Returns
- int
The number of bytes read from the stream, between zero (0) and the number of bytes you requested. Streams return zero (0) only at the end of the stream, otherwise, they should block until at least one byte is available.
Exceptions
- Argument
Null Exception asyncResult
is null.- Argument
Exception A handle to the pending read operation is not available.
-or-
The pending operation does not support reading.- Invalid
Operation Exception asyncResult
did not originate from a BeginRead(byte[], int, method on the current stream.int, Async Callback, object) - IOException
The stream is closed or an internal error has occurred.