/** * Extract the specified Jar Entry to the path given * @param jEnt the JarEntry to extract * @param filename the filename to write the extracted file */ public void extract(JarEntry jEnt, String filename) throws IOException { try { //File output FileOutputStream out = new FileOutputStream(filename); InputStream jis = this.getInputStream(jEnt); int n = 0; try { //buffer byte buffer[] = new byte[BUFFER_SIZE]; while ((n = jis.read(buffer)) > 0) { out.write(buffer, 0, n); } } finally { out.close(); jis.close(); } } catch (IOException e) { throw new IOException("Error while uncompressing the file " + filename + ": " + e.getMessage()); } }