BufferedStream.EndWrite(IAsyncResult) Method (System.IO) (original) (raw)

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

public:
 override void EndWrite(IAsyncResult ^ asyncResult);
public override void EndWrite(IAsyncResult asyncResult);
override this.EndWrite : IAsyncResult -> unit
Public Overrides Sub EndWrite (asyncResult As IAsyncResult)

Parameters

Exceptions

Remarks

In the .NET Framework 4 and earlier versions, you have to use methods such as BeginWrite and EndWrite to implement asynchronous file operations. These methods are still available in the .NET Framework 4.5 to support legacy code; however, the new async methods, such as ReadAsync, WriteAsync, and FlushAsync, help you implement asynchronous file operations more easily.

EndWrite must be called exactly once for every call to BeginRead. Failing to end a read process before beginning another read operation can cause deadlock or other undesirable behavior.

Applies to