Asynchronously clears all buffers for this stream, causes any buffered data to be written to the underlying device, and monitors cancellation requests.
A task that represents the asynchronous flush operation.
When you call the FileStream.FlushAsync(System.Threading.CancellationToken) method, the operating system I/O buffer is also flushed.
If the operation is canceled before it completes, the returned task contains the System.Threading.Tasks.TaskStatus.Canceled value for the System.Threading.Tasks.Task.Status property. If the handle to the file is disposed, the returned task contains the ObjectDisposedException exception in the System.Threading.Tasks.Task.Exception property.