IOutputStream.WriteAsync(IBuffer) 方法

定義

以非同步方式在循序資料流程中寫入資料。

public:
 IAsyncOperationWithProgress<unsigned int, unsigned int> ^ WriteAsync(IBuffer ^ buffer);
IAsyncOperationWithProgress<uint32_t, uint32_t> WriteAsync(IBuffer const& buffer);
public IAsyncOperationWithProgress<uint,uint> WriteAsync(IBuffer buffer);
function writeAsync(buffer)
Public Function WriteAsync (buffer As IBuffer) As IAsyncOperationWithProgress(Of UInteger, UInteger)

參數

buffer
IBuffer

緩衝區,其中包含要寫入的資料。

傳回

IAsyncOperationWithProgress<UInt32,UInt32>

Windows.Foundation.IAsyncOperationWithProgress<unsigned int,unsigned int>

IAsyncOperationWithProgress<uint32_t,uint32_t>

位元組寫入器作業。 第一個整數代表寫入的位元組數目。 第二個整數代表寫入作業的進度。

備註

某些資料流程實作支援寫入作業的佇列。 在此情況下,在 FlushAsync 方法完成之前,WriteAsync 方法的非同步執行不會完成。 針對 緩衝區 參數,您不需要實作 IBuffer 介面。 相反地,您可以建立 Buffer 類別的實例,或使用 CryptographicBuffer 類別中的方法建立緩衝區。

也請考慮使用DataWriter類別的WriteBuffer方法,將緩衝區寫入IOutputStream

適用於