Waits for the pending asynchronous read to complete.
[Visual Basic] Public Overridable Function EndRead( _ ByVal asyncResult As IAsyncResult _ ) As Integer [C#] public virtual int EndRead( IAsyncResult asyncResult ); [C++] public: virtual int EndRead( IAsyncResult* asyncResult ); [JScript] public function EndRead( asyncResult : IAsyncResult ) : int;
- The reference to the pending asynchronous request to finish.
The number of bytes read from the stream, between zero (0) and the number of bytes you requested. Streams only return zero (0) at the end of the stream, otherwise, they should block until at least one byte is available.
|ArgumentNullException||asyncResult is a null reference (Nothing in Visual Basic).|
|ArgumentException||asyncResult did not originate from a BeginRead method on the current stream.|
For an example of creating a file and writing text to a file, see Writing Text to a File. For an example of reading text from a file, see Reading Text from a File. For an example of reading from and writing to a binary file, see Reading and Writing to a Newly Created Data File. For an example of asynchronous file I/O, see Asynchronous File I/O.
Call EndRead to determine how many bytes were read from the stream.
This method blocks until the I/O operation has completed.
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard