Table of Contents

ToByteArray Method

Definition

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

ToByteArray(Stream, Action<StreamCopyOptions>)

Converts the specified input to its equivalent byte array representation.

public static byte[] ToByteArray(this Stream input, Action<StreamCopyOptions> setup = null)

Parameters

input Stream

The Stream to extend.

setup Action<StreamCopyOptions>

The StreamCopyOptions which may be configured.

Returns

byte[]

A byte array that is equivalent to input.

Exceptions

ArgumentNullException

input cannot be null.

ArgumentException

input cannot be read from.