Table of Contents

Method CopyToWithProgressAsync

Namespace
Innova.Data
Assembly
Innova.Data.dll

CopyToWithProgressAsync(Stream, Stream, IProgress<ProgressInfo>, int, long?, CancellationToken)

Asynchronously copies the contents of a Stream to another Stream with progress reporting.

public static Task CopyToWithProgressAsync(this Stream source, Stream destination, IProgress<ProgressInfo> percentProgress, int bufferSize = 32768, long? sourceStreamLength = null, CancellationToken cancellationToken = default)

Parameters

source Stream

The source Stream to copy from.

destination Stream

The destination Stream to copy to.

percentProgress IProgress<ProgressInfo>

The progress reporter that reports the progress of the copy operation.

bufferSize int

The size of the buffer used for copying.

sourceStreamLength long?

The length of the source stream, if known.

cancellationToken CancellationToken

The cancellation token to cancel the copy operation.

Returns

Task

A task representing the asynchronous copy operation.