我有一個可變大小的拉鍊(稱爲從4k到400k),一個拉鍊條目的大量(說1000)。我設法以經典的方式解壓全部,但性能並不令人滿意......您是否知道一種不同的方式,即基於nio或native的方法,可以幫助提高性能?提取大量的拉鍊
在此先感謝。
抱歉..我忘記郵代碼:)
zis = new ZipInputStream(new BufferedInputStream(new FileInputStream(f)));
while ((zentry = zis.getNextEntry()) != null) {
zentryName = zentry.getName();
File unzippedFile = new File(staging, zentryName);
BufferedOutputStream fos = new BufferedOutputStream(new FileOutputStream(unzippedFile));
byte buffer[] = new byte[32768];
while ((read = zis.read(buffer, 0, 32768)) > 0) {
fos.write(buffer, 0, read);
}
f.delete();
fos.flush();
fos.close();
zis.closeEntry();
}
zis.close();
發佈您的當前代碼。 – Wroclai
爲什麼您的平臺上的InfoZip版本解壓縮不能令人滿意? –
@ThorbjørnRavn Andersen礦只是好奇心..有時事情可以做得更好我猜.. – Blackbelt