I need a small code snippet which unzips a few files from a given .zip file and gives the separate files according to the format they were in the zipped file. Please post your knowledge and help me out.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How can I create this custom Bottom Navigation on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
This is my unzip method, which I use:
Minimal example I used to unzip a specific file from my zipfile into my applications cache folder. I then read the manifest file using a different method.
While the answers that are already here work well, I found that they were slightly slower than I had hoped for. Instead I used zip4j, which I think is the best solution because of its speed. It also allowed for different options for the amount of compression, which I found useful.
UPDATE 2016 use the following class
How to use
Permissions
Here is a ZipFileIterator (like a java Iterator, but for zip files):
Had peno's version optimised a bit. The increase in performance is perceptible.