I have a big archive (zip in my case) with size ~100MB and with ~15000 files in it. I need to QUICKLY extract only one file form this archive.
I tried the next code:
final String zipPath = "archive.zip";
FileInputStream fin = new FileInputStream(zipPath);
in = new ZipInputStream(fin);
for (ZipEntry entry = in.getNextEntry(); entry != null; entry = in.getNextEntry()) {
if(entry.equals("file.name")){
//unzip this entry
break;
}
}
It works but too SLOW.
Is it some another possibility to find necessary file in archive? For example, on linux it extremally fast possible with command
unzip archive.zip myfile.name
In general, I need to find and decompress one file from some archive. It can be some another format... May be with another format it can be more easy.