MemoryStream

Sep 14, 2009 at 1:47 PM

Hi,

I was working my way through the manual, but I see no references which handle compression from a memorystream. All the entries require filenames or a filestream. Apart from this, all of the add options I see which handle FileStreams in ZipEntry have a [depricated] tag, but I don't see an alternative method which handles streams.

Did I miss something or am I now using the package right?

Thanks for your answer.

Coordinator
Sep 14, 2009 at 1:57 PM
  using (ZipFile zip = new ZipFile())
  {
    ZipEntry e= zip.AddEntry("Content-From-Stream.bin", "basedirectory", streamToRead);
    e.Comment = "The content for entry in the zip file was obtained from a stream";
    zip.AddFile("Readme.txt");
    zip.Save(ZipToCreate);
  }

Sep 14, 2009 at 3:24 PM

Thanks for the quick reply!