private void CopyStream(Stream source, Stream destination) { byte[] buffer = new byte[ChunkSize]; int cnt; while((cnt = source.Read(buffer, 0, ChunkSize)) > 0) { destination.Write(buffer, 0, cnt); } destination.Flush(); }