This content has been marked as final. Show 4 replies
I have successfully done it.
You cannot have the code - it is proprietary.
However here are a few pointers:
o Use ZipStreams rather than ZipFile.
o ZipStream is just a filter on a stream, so you can have a zipstream open, read a ZipEntry, then ask for a substream for the stuff up to the next ZipEntry. Put a second ZipStream on that substream.
o As I recall you have to watch out that your inner ZipStream does not do a close. (Everything will get closed.) Instead, there is another ZipStream method that will close without closing all the underlying streams.
Hope this helps.
Software can't get a list of the ZipEntries without being able to read the catalog of the zip file. And that catalog is stored at the end of the zip file, so it needs random access to the zip file to do that. And you can't have random access to a compressed file, you have to decompress it first.
That's why you don't find anything about how to work with nested zip files. Because you can't.
OK, I've got it mostly working, but how do you get a stream
if you don't have a file object?? I can say zipFile.getInputStream
but I can't say zipInputStream.getInputStream, which could give
me a stream from within the bigger stream. I cannot find methods
for either ZipEntry or ZipInputStream that allow me to do this... I
was trying to do a read but that results in a file with errors, most
likely because I am not reading starting at the correct location in
Were you able to get this to work ?
If yes, would it be possible to publish the code ?
I'm struggling with the same problem and its driving me insane :-)