Here you can find the source of unZipFile(File destFile, ZipFile zipFile, ZipEntry entry)
private static void unZipFile(File destFile, ZipFile zipFile, ZipEntry entry) throws IOException
//package com.java2s; // %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; public class Main { private static int bufSize = 2048; private static void unZipFile(File destFile, ZipFile zipFile, ZipEntry entry) throws IOException { InputStream inputStream;/*ww w. j a v a 2s . co m*/ FileOutputStream fileOut; if (entry.isDirectory()) { destFile.mkdirs(); } else { File parent = destFile.getParentFile(); if (parent != null && !parent.exists()) { parent.mkdirs(); } inputStream = zipFile.getInputStream(entry); fileOut = new FileOutputStream(destFile); byte[] buf = new byte[bufSize]; int readedBytes; while ((readedBytes = inputStream.read(buf)) > 0) { fileOut.write(buf, 0, readedBytes); } fileOut.close(); inputStream.close(); } } }