Table of Contents

ToByteArrayAsync Method

Definition

Namespace
Cuemon.Extensions.IO
Assemblies
Cuemon.Extensions.IO.dll
Source
src/Cuemon.Extensions.IO/StreamExtensions.cs

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

input Stream

The Stream to extend.

setup Action<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

input cannot be null.

ArgumentException

input cannot be read from.