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
sourceStreamThe source Stream to copy from.
destinationStreamThe destination Stream to copy to.
percentProgressIProgress<ProgressInfo>The progress reporter that reports the progress of the copy operation.
bufferSizeintThe size of the buffer used for copying.
sourceStreamLengthlong?The length of the source stream, if known.
cancellationTokenCancellationTokenThe cancellation token to cancel the copy operation.
Returns
- Task
A task representing the asynchronous copy operation.