unzip the contents on fly without creating physical zip file on the system
I have a zip file in byte[]. I need to extract the zipfile contents on fly without actually creating a zip file on the disk.
Is there any equivalent method like zipFile.entries() so that I can iterate the contents and get the ZipEntry. I would appreciate your help.
I tried the following code and was able to get only one file out of 3 files in the zip file(decodedZip).
public static void unZipContent(byte[] decodedZip) {
ZipInputStream in = null;
try {
ByteArrayInputStream bais = new ByteArrayInputStream(decodedZip);
in = new ZipInputStream(bais);
while (in.available() > 0) {
ZipEntry entry = in.getNextEntry();
if (entry != null) {
String outFilename = entry.getName();
System.out.println("filename is " + entry.getName());
}
}
catch(){}
}

