Retrieve a compressed file from a ZIP file
import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.OutputStream; import java.util.zip.ZipInputStream; public class Main { public static void main(String[] argv) throws Exception { ZipInputStream in = new ZipInputStream(new FileInputStream("source.zip")); OutputStream out = new FileOutputStream("target"); byte[] buf = new byte[1024]; int len; while ((len = in.read(buf)) > 0) { out.write(buf, 0, len); } out.close(); in.close(); } }