This project is read-only.

Zipping a ZipFile

Jul 27, 2015 at 5:17 AM
How (or can) I zip one ZipFile up within another ZipFile?

Saving the nested ZipFile to a memory stream that is then written to the other ZipFile seems like the best way to do this, however when I use the code below the nested ZipFile (once I unpacked zip1) is 0KB large and has nothing in it.

Is this possible without writing the nested ZipFile to disk first and then adding that into zip1 afterwards?
            ZipFile zip1 = new ZipFile()
                ParallelDeflateThreshold = -1
            ZipFile zip2 = new ZipFile()
                ParallelDeflateThreshold = -1

            zip1.AddEntry("test.txt", "hello world");
            zip2.AddEntry("test2.txt", "hello dark world");
            MemoryStream stream = new MemoryStream();
            zip1.AddEntry("", stream);