NFe.StreamExtensions.CopyTo C# (CSharp) Method

CopyTo() public static method

public static CopyTo ( this from, Stream to ) : long
from this
to Stream
return long
        public static long CopyTo(this Stream from, Stream to)
        {
            byte[] buffer = new byte[2048];
            int bytesRead;
            long totalBytes = 0;
            while ((bytesRead = from.Read(buffer, 0, buffer.Length)) > 0)
            {
                to.Write(buffer, 0, bytesRead);
                totalBytes += bytesRead;
            }
            return totalBytes;
        }
StreamExtensions