Stream.FlushAsync Method (CancellationToken)

July 28, 2014

Asynchronously clears all buffers for this stream, causes any buffered data to be written to the underlying device, and monitors cancellation requests.

Namespace:  System.IO
Assembly:  mscorlib (in mscorlib.dll)

public virtual Task FlushAsync(
	CancellationToken cancellationToken
)

Parameters

cancellationToken
Type: System.Threading.CancellationToken
The token to monitor for cancellation requests. The default value is None.

Return Value

Type: System.Threading.Tasks.Task
A task that represents the asynchronous flush operation.

ExceptionCondition
ObjectDisposedException

The stream has been disposed.

If the operation is canceled before it completes, the returned task contains the Canceled value for the Status property.

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2014 Microsoft