ToByteArrayAsync Method
Definition
- Namespace
- Cuemon.Extensions.IO
- Assemblies
- Cuemon.Extensions.IO.dll
ToByteArrayAsync(Stream, Action<AsyncStreamCopyOptions>)
Converts the specified input to its equivalent byte array representation.
public static Task<byte[]> ToByteArrayAsync(this Stream input, Action<AsyncStreamCopyOptions> setup = null)
Parameters
inputStreamThe Stream 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
input.
Exceptions
- ArgumentNullException
inputcannot be null.- ArgumentException
inputcannot be read from.