Stream.FlushAsync Stream.FlushAsync Stream.FlushAsync Stream.FlushAsync Method

定义

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

重载

FlushAsync(CancellationToken) FlushAsync(CancellationToken) 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() FlushAsync() FlushAsync() FlushAsync()

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

FlushAsync(CancellationToken) FlushAsync(CancellationToken) 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 CancellationToken CancellationToken CancellationToken

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

返回

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

异常

注解

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

如果派生类,如DeflateStreamGZipStream,将在其实现中的缓冲区未刷新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() FlushAsync() FlushAsync() 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.

异常

注解

如果派生类,如DeflateStreamGZipStream,将在其实现中的缓冲区未刷新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.

适用于