In Java you have to do
new ZipFile(new File(“xxx.zip”));
to unzip a zip file.
Now I get a byte array whose content is a zip file. I get this byte array from database instead of a file. I would like to unzip this “byte array file” but there is no ZipFile constructor for byte array or String (I mean the content instead of the file path).
Is there any solution? (Of course I do not want to write this byte array to an actual file and read it into memory again.)
Thanks!
Use a ByteArrayInputStream inside the ZipInputStream which is created from a byte array
Use zis to read the contents uncompressed