예제 #1
0
        public long TransferTo(RarReader reader, Stream source, Stream destination)
        {
            var array = new byte[81920];
            long total = 0;
            int count;
            while ((count = source.Read(array, 0, array.Length)) != 0)
            {
                total += count;
                destination.Write(array, 0, count);
                if (total > 5000000)
                {
                    // Just as a test
                    reader.Cancel();
                    return -1;
                }
            }

            return total;
        }