Table of Contents

CopyStream Method

Definition

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

CopyStream(IDecorator<Stream>, Stream, int, bool)

Copies the contents of the enclosed Stream to the specified destination.

public static void CopyStream(this IDecorator<Stream> decorator, Stream destination, int bufferSize = 81920, bool changePosition = true)

Parameters

decorator IDecorator<Stream>

The IDecorator<T> that wraps the source stream.

destination Stream

The destination stream to which the contents of the source stream are copied.

bufferSize int

The size of the buffer, in bytes. The value must be greater than zero. The default is 81920.

changePosition bool

true to temporarily reset the position of the enclosed stream to the beginning before copying; otherwise, false to preserve the current position.

Exceptions

ArgumentNullException

decorator is null.