title: OutOfMemoryException with MemoryStream()
body: <p>I have a problem of OutOfMemoryException in this piece of C# code.</p>
  
  <pre><code>private void SaveZip(IDataReader reader, string header, string fileName, Ionic.Zip.ZipFile zip)
      {
          using (var stream = new MemoryStream())
          {
              using (var writer = new StreamWriter(stream, Encoding.ASCII))
              {
                  writer.WriteLine(header);
                  while (reader.Read())
                  {
                      writer.WriteLine(reader.GetString(0)); //exception occurs here
                  }
  
                  writer.Close();
              }
  
              zip.AddEntry(fileName, stream.ToArray());
          }
      }
  </code></pre>
  
  <p>The code tries to write the DataReader object into a file, which being zipped at the end of the procedure. The problem is that the Reader contains a large set of data, about 150MB, and it originates the exception when I try to write the stream on memory.
  How could I resolve this?</p>
  
  <p>Thanks for help!</p>