title: How to merge two memory streams?
body: <p>I have two MemoryStream instances.</p>
  
  <p>How to merge them into one instance?</p>
  
  <p>Well, now I can't copy from one MemoryStream to another.
  Here is a method:</p>
  
  <pre><code>public static Stream ZipFiles(IEnumerable&lt;FileToZip&gt; filesToZip) {
  ZipStorer storer = null;
          MemoryStream result = null;
          try {
              MemoryStream memory = new MemoryStream(1024);
              storer = ZipStorer.Create(memory, GetDateTimeInRuFormat());
              foreach (var currentFilePath in filesToZip) {
                  string fileName = Path.GetFileName(currentFilePath.FullPath);
                  storer.AddFile(ZipStorer.Compression.Deflate, currentFilePath.FullPath, fileName,
                                 GetDateTimeInRuFormat());
              }
              result = new MemoryStream((int) storer.ZipFileStream.Length);
              storer.ZipFileStream.CopyTo(result); //Does not work! 
                                                 //result's length will be zero
          }
          catch (Exception) {
          }
          finally {
              if (storer != null)
                  storer.Close();
          }
          return result;
      }
  </code></pre>