ToByteArrayAsync Method
Definition
- Assemblies
- Cuemon.IO.dll
ToByteArrayAsync(IDecorator<Stream>, Action<AsyncStreamCopyOptions>)
Converts the enclosed Stream of the specified decorator to its equivalent byte array representation.
public static Task<byte[]> ToByteArrayAsync(this IDecorator<Stream> decorator, Action<AsyncStreamCopyOptions> setup = null)
Parameters
decoratorIDecorator<Stream>The IDecorator<T> to extend.
setupAction<AsyncStreamCopyOptions>The AsyncStreamCopyOptions which may be configured.
Returns
- Task<byte[]>
A task that represents the asynchronous operation. The task result contains a byte array that is equivalent to the enclosed Stream of the specified
decorator.
Exceptions
- ArgumentNullException
decoratorcannot be null.- ArgumentException
The enclosed Stream of
decoratorcannot be read from.