Java tutorial
import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.InputStream; import java.util.jar.JarOutputStream; import java.util.jar.Pack200; import java.util.zip.GZIPInputStream; public class Main { public static void main(String[] args) throws Exception { String inName = "abc.pack.gz"; String outName = "abc"; Pack200.Unpacker unpacker = Pack200.newUnpacker(); JarOutputStream out = new JarOutputStream(new FileOutputStream(outName)); InputStream in = new FileInputStream(inName); if (inName.endsWith(".gz")) { in = new GZIPInputStream(in); } unpacker.unpack(in, out); out.close(); } }