/*** 解压zip文件* * @param zipFile* @param zipPath* @throws IOException*/public static void unzip(File zipFile, File zipPath) throws IOException {ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFile));ZipEntry entry = null;byte[] data = new byte[1024];int count = 0;while ((entry = zis.getNextEntry()) != null) {String name = entry.getName();name = zipPath.getName() + "/" + name;File file = new File(name);if (entry.isDirectory()) {file.mkdirs();} else {BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(file));while ((count = zis.read(data, 0, data.length)) != -1) {bos.write(data, 0, count);}bos.close();}}zis.close();}
700字范文,内容丰富有趣,生活中的好帮手!