Skip to main content

ZIP support files larger than 2GB

7 replies [Last post]
rogerhernandez
Offline
Joined: 2005-02-23

The ZIP classes that are part of the JDK do not support compressing files > 2GB. We are compressing large database export CSV files, and I have had to resort to calling an instance of gzip.exe.

Are there any plans to add large file support to the JDK ZIP classes? Note that there are two levels of support. Ideally we would like both levels supported.
1) Support compressing from/extracting to files larger than 2GB.
2) Support working with ZIP/JAR archives larger than 2GB.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
leo2
Offline
Joined: 2006-09-29

The first bug posting in davenull's list:

http://bugs.sun.com/bugdatabase/view_bug?bug_id=4418997

also mentions an issue with the number of ZipEntries that can be created in a ZipFile. That issue has not been fixed as of jdk 1.5.0_09. Looks like internally a short int is being used to index zip entries, so after 64k it rolls over. Any chance this will get fixed?

davenull
Offline
Joined: 2004-12-07

The limitation of 64k entries in a zip file was fixed in JDK 6 build 25:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4828461

davenull
Offline
Joined: 2004-12-07

I ran some gzip and zip tests against 1.5.0_08 and the JDK 6 (build 96). They indicate that gzip files > 2GB are supported, and similarly large ZIP files, and ZIP files with > 2GB entries. Related bugs are reportedely fixed:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4418997
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4262583
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4795136
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5092263

If you have a testcase which demonstrates otherwise, please do tell (and file a bug!)

- davenull

sjasja
Offline
Joined: 2004-08-15

Those bug reports are for files between 2GB and 4GB. Did you try files bigger than 4GB? I.e. ZIP64 support. (Not that I need it...)

davenull
Offline
Joined: 2004-12-07

IIRC, we haven't tested files larger than 4 GB. If it's important, please consider voting:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4681995

fireball
Offline
Joined: 2003-06-19

Are you using gzip files or ZIP files? You seemed to be contradicting yourself about what you are using.

rogerhernandez
Offline
Joined: 2005-02-23

They both have the same problem. The latest standard of each file format supports files > 2GB. The corresponding java classes do not.