Table of Contents

ToByteArray Method

Definition

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

ToByteArray(IDecorator<Stream>, Action<StreamCopyOptions>)

Converts the enclosed Stream of the specified decorator to its equivalent byte array representation.

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

Parameters

decorator IDecorator<Stream>

The IDecorator<T> to extend.

setup Action<StreamCopyOptions>

The StreamCopyOptions which may be configured.

Returns

byte[]

A byte array that is equivalent to the enclosed Stream of the specified decorator.

Exceptions

ArgumentNullException

decorator cannot be null.

ArgumentException

The enclosed Stream of decorator cannot be read from.