【发布时间】:2012-06-06 17:43:36
【问题描述】:
我目前有以下代码,它使用 ZipInputStream 实例将 zip 文件解压缩到手机上的目标位置:
ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(sourceZipFile));
ZipEntry zipEntry = null;
while ((zipEntry = zipInputStream.getNextEntry()) != null) {
File zipEntryFile = new File(targetFolder, zipEntry.getName());
// write contents of 'zipEntry' to 'zipEntryFile'
}
有谁知道在开始之前是否有可能(使用上述设置或其他设置)获取(估计)要解压缩的文件或字节的总数,以便在解压缩进行时显示进度指示器?我以为ZipInputStream 可能有getTotalEntries() 或类似的方法,但我找不到这样的方法。
【问题讨论】:
标签: java android zipinputstream