Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Read ZIP files where archive and/or contained files are larger than 4gig?

807588Aug 5 2009 — edited Aug 7 2009
I need to read the file lists (i.e. names, CRC, original size, etc.) for all the files contained in ZIP files.

The zip files are created with both 7zip (using the zip format) and WinZip.

The files are frequently larger than 4 gigs and the files in the archive files (i.e. the ZipEntries) are frequently greater than 4 gigs.

The files are completely accessible from 7zip, winzip an winrar and none of these applications report an corruption problems or anything with these files.

However, I gcan't seem to write a Java app that can reliably read the contents of these files.

I've come to the conclusion that the problem is likely the 4gig limitation. I started by using java.util.zip.ZipFile but quickly ran into the 4gig limitation on the total archive file. So, I switched to the recommended workaround of using ZipInputStream. My first problem with this was performance. getNextEntity would be painfully slow a lot of the time. Then I think I hit the 4gig limitation again when I received a "ZipExpception: invalid entry size:(expected: 429496795 but got 4246755840 bytes)" when it tried to do the getNextEntity after successfully returning a reference to an entity that is greater than 4 gigs. I asume it was reading the size of that entity into an Int, obviously getting the wrong number, then trying to scan through the file to get to the next entity. Does that sound plausible?

I've been searching everywhere for a library that actually supports the newer (or should I say current by this time) ZIP file standards; support for large files sizes, support for foreign characters in file names, etc., etc. but haven't found ANYTHING!

Is there really such a huge gaping hole in support for ZIP files within Java!?!?!

There's GOT to be a solution out there SOMEWHERE!?!? Isn't there?


PLEASE HELP!

Edited by: tommalia on Aug 5, 2009 11:02 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 4 2009
Added on Aug 5 2009
9 comments
8,348 views