Waits for the pending asynchronous read to complete. (Consider using Stream.ReadAsync(Byte[], int, int) instead; see the Remarks section.)
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.
Type Reason ArgumentNullException asyncResult is null. ArgumentException asyncResult did not originate from a Stream.BeginRead(Byte[], int, int, AsyncCallback, object) method on the current stream.
In the .NET Framework 4 and earlier versions, you have to use methods such as Stream.BeginRead(Byte[], int, int, AsyncCallback, object) and Stream.EndRead(IAsyncResult) to implement asynchronous I/O operations. These methods are still available in the net_v45 to support legacy code; however, the new async methods, such as Stream.ReadAsync(Byte[], int, int), Stream.WriteAsync(Byte[], int, int), Stream.CopyToAsync(Stream), and Stream.FlushAsync, help you implement asynchronous I/O operations more easily.
Call EndRead to determine how many bytes were read from the stream.
EndRead can be called once on every IAsyncResult from Stream.BeginRead(Byte[], int, int, AsyncCallback, object).
This method blocks until the I/O operation has completed.