Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void CopyStreams(Stream sourceStream,Stream destStream) {
- if(sourceStream == null)
- throw new ArgumentNullException("sourceStream");
- if(destStream == null)
- throw new ArgumentNullException("destStream");
- byte[] buffer = new byte[4096];
- for(int len;(len = sourceStream.Read(buffer,0,buffer.Length)) > 0;)
- destStream.Write(buffer,0,len);
- }
Add Comment
Please, Sign In to add comment