IOutputStream.WriteAsync(IBuffer) IOutputStream.WriteAsync(IBuffer) IOutputStream.WriteAsync(IBuffer) IOutputStream.WriteAsync(IBuffer) IOutputStream.WriteAsync(IBuffer) Method

Definition

Writes data asynchronously in a sequential stream.

public : IAsyncOperationWithProgress<unsigned int, unsigned int> WriteAsync(IBuffer buffer)
IAsyncOperationWithProgress<uint32_t, uint32_t> WriteAsync(IBuffer buffer) const;
public IAsyncOperationWithProgress<uint, uint> WriteAsync(IBuffer buffer)
Public Function WriteAsync(buffer As IBuffer) As IAsyncOperationWithProgress(Of uintuint)
Windows.Storage.Streams.IOutputStream.writeAsync(buffer).done( /* Your success and error handlers */ );

Parameters

buffer
IBuffer IBuffer IBuffer

A buffer that contains the data to be written.

Returns

The byte writer operation. The first integer represents the number of bytes written. The second integer represents the progress of the write operation.

Remarks

Some stream implementations support queuing of write operations. In this case, the asynchronous execution of the WriteAsync method does not complete until the FlushAsync method has completed. For the buffer parameter, you don't have to implement the IBuffer interface. Instead, you can create an instance of the Buffer class or create a buffer by using methods in the CryptographicBuffer class.

Also consider writing a buffer into an IOutputStream by using the WriteBuffer method of the DataWriter class.