Here you can find the source of unzipEntry(ZipInputStream zis, File targetFile)
protected static File unzipEntry(ZipInputStream zis, File targetFile) throws Exception
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FileOutputStream; import java.util.zip.ZipInputStream; public class Main { private static final int BUFFER_SIZE = 1024 * 2; protected static File unzipEntry(ZipInputStream zis, File targetFile) throws Exception { FileOutputStream fos = null; try {//from www . j a v a2 s .c o m fos = new FileOutputStream(targetFile); byte[] buffer = new byte[BUFFER_SIZE]; int len = 0; while ((len = zis.read(buffer)) != -1) { fos.write(buffer, 0, len); } } finally { if (fos != null) { fos.close(); } } return targetFile; } }