What is currently the best library to do zip64 with in Java? I need to zip and unzip files / directories larger than 4 GB.
I read that Java 7 has support for zip64. But I guess if I develop for Java 7 this only works if all the computers on which the application will be installed have Java 7 JRE? Is this correct?
At the moment I am using http://sourceforge.net/projects/zip64file/ . But here I was wondering if this is still the best choice? I would like to have a library that supports zipping of directories out of the box. Now I have to do the traversing of the directory structure myself.
To unzip a zip file, we need to read the zip file with ZipInputStream and then read all the ZipEntry one by one. Then use FileOutputStream to write them to file system. We also need to create the output directory if it doesn't exists and any nested directories present in the zip file.
util. zip Description. Provides classes for reading and writing the standard ZIP and GZIP file formats. Also includes classes for compressing and decompressing data using the DEFLATE compression algorithm, which is used by the ZIP and GZIP file formats.
Steps to Compress a File in JavaOpen a ZipOutputStream that wraps an OutputStream like FileOutputStream. The ZipOutputStream class implements an output stream filter for writing in the ZIP file format. Put a ZipEntry object by calling the putNextEntry(ZipEntry) method on the ZipOutputStream.
Zip4j is the most comprehensive Java library for zip files or streams.
Also Apache Commons Compress supports Zip64 format.
Looks like TrueZIP 6.7 Beta has the features you need http://cworld.wikidot.com/development:open-source-java-zip64-library-truezip
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With