Ends an asynchronous write operation.
[Visual Basic] Public Overridable Sub EndWrite( _ ByVal asyncResult As IAsyncResult _ ) [C#] public virtual void EndWrite( IAsyncResult asyncResult ); [C++] public: virtual void EndWrite( IAsyncResult* asyncResult ); [JScript] public function EndWrite( asyncResult : IAsyncResult );
- A reference to the outstanding asynchronous I/O request.
|ArgumentNullException||asyncResult is a null reference (Nothing in Visual Basic).|
|ArgumentException||asyncResult did not originate from a BeginWrite 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.
This method blocks until the I/O operation has completed. Errors that occur during an asynchronous write request, such as a disk failure during the I/O request, occur on the threadpool thread and become visible upon a call to EndWrite. Exceptions thrown by the threadpool thread will not be visible when calling EndWrite.
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