Ответ 1
Лучший вариант, который я могу увидеть, - Apache Commons Compress с этой зависимостью от Maven.
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.0</version>
</dependency>
Из examples:
FileInputStream in = new FileInputStream("archive.tar.bz2"); FileOutputStream out = new FileOutputStream("archive.tar"); BZip2CompressorInputStream bzIn = new BZip2CompressorInputStream(in); final byte[] buffer = new byte[buffersize]; int n = 0; while (-1 != (n = bzIn.read(buffer))) { out.write(buffer, 0, n); } out.close(); bzIn.close();