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.

如果衍生類別中,這類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() 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.

例外狀況

備註

如果衍生類別中,這類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.

適用於