List of utility methods to do ZipInputStream Save
List | upzip(ZipInputStream zip, String destPath) upzip List fileNames = new ArrayList(); ZipEntry azipfile = null; while ((azipfile = zip.getNextEntry()) != null) { String name = azipfile.getName(); fileNames.add(name); if (!azipfile.isDirectory()) { File targetFile = new File(destPath, name); targetFile.getParentFile().mkdirs(); ... |
File | unzipEntry(ZipInputStream zis, File targetFile) Unzip one entry FileOutputStream fos = new FileOutputStream(targetFile); byte[] buffer = new byte[BUFFER_SIZE]; int len = 0; while ((len = zis.read(buffer)) != -1) { fos.write(buffer, 0, len); return targetFile; |
File | unzipEntry(ZipInputStream zis, File targetFile) unzip Entry FileOutputStream fos = new FileOutputStream(targetFile); byte[] buffer = new byte[BUFFER_SIZE]; int len = 0; while ((len = zis.read(buffer)) != -1) { fos.write(buffer, 0, len); return targetFile; |