Decompressing a File This example reads a ZIP file and decompresses the first entry. try { String inFilename = "infile.zip"; String outFilename = "outfile"; ZipInputStream in = new ZipInputStream( new FileInputStream(inFilename)); OutputStream out = new FileOutputStream( outFilename); ZipEntry entry; byte[] buf = new byte[1024]; int len; if ((entry = in.getNextEntry()) != null) { while ((len = in.read(buf)) > 0) { out.write(buf, 0, len); } } out.close(); in.close(); } catch (IOException e) { }