Method CopyToWithProgressAsync
CopyToWithProgressAsync(Stream, Stream, IProgress<ProgressInfo>, int, long?, CancellationToken)
public static Task CopyToWithProgressAsync(this Stream source, Stream destination, IProgress<ProgressInfo> percentProgress, int bufferSize = 32768, long? sourceStreamLength = null, CancellationToken cancellationToken = default)
Parameters
source
StreamThe source Stream to copy from.
destination
StreamThe destination Stream to copy to.
percentProgress
IProgress<ProgressInfo>The progress reporter that reports the progress of the copy operation.
bufferSize
intThe size of the buffer used for copying.
sourceStreamLength
long?The length of the source stream, if known.
cancellationToken
CancellationTokenThe cancellation token to cancel the copy operation.
Returns
- Task
A task representing the asynchronous copy operation.