Stream.FlushAsync 方法

定义

异步清除此流的所有缓冲区并导致所有缓冲数据都写入基础设备中。Asynchronously clears all buffers for this stream and causes any buffered data to be written to the underlying device.

重载

FlushAsync(CancellationToken)

异步清理这个流的所有缓冲区,并使所有缓冲数据写入基础设备,并且监控取消请求。Asynchronously clears all buffers for this stream, causes any buffered data to be written to the underlying device, and monitors cancellation requests.

FlushAsync()

异步清除此流的所有缓冲区并导致所有缓冲数据都写入基础设备中。Asynchronously clears all buffers for this stream and causes any buffered data to be written to the underlying device.

FlushAsync(CancellationToken)

异步清理这个流的所有缓冲区,并使所有缓冲数据写入基础设备,并且监控取消请求。Asynchronously clears all buffers for this stream, causes any buffered data to be written to the underlying device, and monitors cancellation requests.

public:
 virtual System::Threading::Tasks::Task ^ FlushAsync(System::Threading::CancellationToken cancellationToken);
[System.Runtime.InteropServices.ComVisible(false)]
public virtual System.Threading.Tasks.Task FlushAsync (System.Threading.CancellationToken cancellationToken);
abstract member FlushAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.FlushAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task

参数

cancellationToken
CancellationToken

要监视取消请求的标记。The token to monitor for cancellation requests. 默认值为 NoneThe default value is None.

返回

表示异步刷新操作的任务。A task that represents the asynchronous flush operation.

属性

异常

已释放流。The stream has been disposed.

注解

如果在操作完成前取消该操作, 则返回的任务包含Canceled Status属性的值。If the operation is canceled before it completes, the returned task contains the Canceled value for the Status property.

如果派生类( DeflateStream如或GZipStream)未Flush在其方法的实现中刷新缓冲区,则该FlushAsync方法将不刷新缓冲区。If a derived class, such as DeflateStream or GZipStream, does not flush the buffer in its implementation of the Flush method, the FlushAsync method will not flush the buffer.

另请参阅

FlushAsync()

异步清除此流的所有缓冲区并导致所有缓冲数据都写入基础设备中。Asynchronously clears all buffers for this stream and causes any buffered data to be written to the underlying device.

public:
 System::Threading::Tasks::Task ^ FlushAsync();
[System.Runtime.InteropServices.ComVisible(false)]
public System.Threading.Tasks.Task FlushAsync ();
member this.FlushAsync : unit -> System.Threading.Tasks.Task
Public Function FlushAsync () As Task

返回

表示异步刷新操作的任务。A task that represents the asynchronous flush operation.

属性

异常

已释放流。The stream has been disposed.

注解

如果派生类( DeflateStream如或GZipStream)未Flush在其方法的实现中刷新缓冲区,则该FlushAsync方法将不刷新缓冲区。If a derived class, such as DeflateStream or GZipStream, does not flush the buffer in its implementation of the Flush method, the FlushAsync method will not flush the buffer.

适用于