private static Task CopyStream(Stream source, Stream destination, Action<long> progressReport, int bufferSize, CancellationToken token) { var listenableStream = new ListenableStream(source); listenableStream.ReadingProgress += (_, progress) => progressReport(progress.Processed); return listenableStream.CopyToAsync(destination, bufferSize, token); }
private static Task CopyStream(Stream source, Stream destination, Action <long> progressReport, int bufferSize, CancellationToken token) { var listenableStream = new ListenableStream(source); listenableStream.ReadingProgress += (_, progress) => progressReport(progress.Processed); return(listenableStream.CopyToAsync(destination, bufferSize, token)); }