IOutputStream::FlushAsync method

Creates an asynchronous sequential flush operation object.

Syntax

HRESULT FlushAsync(
  [out, retval] IAsyncOperation<boolean> **operation
);

Parameters

  • operation [out, retval]
    The asynchronous operation for flushing the byte stream.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The FlushAsync method ensures that the data reaches the target storage medium that the stream represents. For example, a file stream can respond to a write operation by copying the buffer into another temporary storage medium and completing immediately while the target device begins writing the data in parallel, to improve application responsiveness and throughput.

The FlushAsync method does not complete until all data specified in previous write calls have reached the target storage media. If the data can't be written, or some error occurs during the write operation, the error is reported to the app through the flush operation. For streams that write the data immediately, the FlushAsync method has no effect and completes immediately.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Header

Robytestream.h

IDL

Robytestream.idl

See also

IOutputStream

WriteAsync

IInputStream

ReadAsync