PageRenderTime 12ms CodeModel.GetById 7ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/Main/src/DynamicDataDisplay/Common/Auxiliary/StreamExtensions.cs

#
C# | 23 lines | 22 code | 1 blank | 0 comment | 2 complexity | 08969ac245acc8be4df2f6e9c9690897 MD5 | raw file
 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4using System.Text;
 5using System.IO;
 6
 7namespace Microsoft.Research.DynamicDataDisplay.Common.Auxiliary
 8{
 9    public static class StreamExtensions
10    {
11        public static void CopyTo(this Stream input, Stream output)
12        {
13            byte[] buffer = new byte[32768];
14            while (true)
15            {
16                int read = input.Read(buffer, 0, buffer.Length);
17                if (read <= 0)
18                    return;
19                output.Write(buffer, 0, read);
20            }
21        }
22    }
23}