示例#1
0
		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);
		}
示例#2
0
        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));
        }