PageRenderTime 39ms CodeModel.GetById 17ms RepoModel.GetById 1ms 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
Possible License(s): CC-BY-SA-3.0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.IO;
  6. namespace Microsoft.Research.DynamicDataDisplay.Common.Auxiliary
  7. {
  8. public static class StreamExtensions
  9. {
  10. public static void CopyTo(this Stream input, Stream output)
  11. {
  12. byte[] buffer = new byte[32768];
  13. while (true)
  14. {
  15. int read = input.Read(buffer, 0, buffer.Length);
  16. if (read <= 0)
  17. return;
  18. output.Write(buffer, 0, read);
  19. }
  20. }
  21. }
  22. }