copy stream to stream
Published: 13. December 2008 | Updated: 9. October 2011License: Microsoft Public License (MS-PL)
Categories: Streams
Tags: C#
Method for copy stream to stream
public static void CopyStream(Stream input, Stream output) { int bufferSize = 4096; byte[] buffer = new byte[bufferSize]; while (true) { int read = input.Read(buffer, 0, buffer.Length); if (read <= 0) { return; } output.Write(buffer, 0, read); } }
| Send us feedback about this snippet » |





