CASCExplorer.SyncDownloader.CopyToStream C# (CSharp) Method

CopyToStream() private method

private CopyToStream ( Stream src, Stream dst, long len ) : void
src System.IO.Stream
dst System.IO.Stream
len long
return void
        private void CopyToStream(Stream src, Stream dst, long len)
        {
            long done = 0;

            byte[] buf = new byte[0x1000];

            int count;
            do
            {
                if (progressReporter != null && progressReporter.CancellationPending)
                    return;

                count = src.Read(buf, 0, buf.Length);
                dst.Write(buf, 0, count);

                done += count;

                progressReporter?.ReportProgress((int)(done / (float)len * 100));
            } while (count > 0);
        }