Newer
Older
ClosedXML / ClosedXML / Extensions / StreamExtensions.cs
@Francois Botha Francois Botha on 6 Sep 2017 475 bytes Add support for .NET 3.5
#if _NET35_
using System.IO;

namespace ClosedXML.Extensions
{
    internal static class StreamExtensions
    {
        public static void CopyTo(this Stream input, Stream output)
        {
            byte[] buffer = new byte[16 * 1024]; // Fairly arbitrary size
            int bytesRead;

            while ((bytesRead = input.Read(buffer, 0, buffer.Length)) > 0)
            {
                output.Write(buffer, 0, bytesRead);
            }
        }
    }
}
#endif