WriteAllAsync Method
Definition
- Assemblies
- Cuemon.IO.dll
WriteAllAsync(IDecorator<Stream>, byte[], CancellationToken)
Asynchronously writes a sequence of bytes to the enclosed Stream of the decorator with the entire size of the buffer starting from position 0.
public static Task WriteAllAsync(this IDecorator<Stream> decorator, byte[] buffer, CancellationToken ct = default)
Parameters
decoratorIDecorator<Stream>The IDecorator<T> to extend.
bufferbyte[]The buffer to write data from.
ctCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task
A task that represents the asynchronous write operation.
Exceptions
- ArgumentNullException
decoratoris null -or-bufferis null.- NotSupportedException
The enclosed Stream of
decoratordoes not support writing.- ObjectDisposedException
The enclosed Stream of
decoratorhas been disposed.- InvalidOperationException
The enclosed Stream of
decoratoris currently in use by a previous write operation.