0

How can I get:

java.util.zip.ZipException ZIP_Read: error reading zip file?

I've tried with different corrupted zips, corrupted jars, but no luck so far. Any idea?

gonzo33
  • 11
  • 2

1 Answers1

0
private void play() {
    try {
        ZipFile zipFile = new ZipFile("./data/demo.zip");
        ZipArchiveEntry zipArchiveEntry;
        Enumeration<ZipArchiveEntry> entries = zipFile.getEntries();
        while (entries.hasMoreElements()) {
            zipArchiveEntry = entries.nextElement();
            long size = zipArchiveEntry.getSize();
        // more code
        }
    } catch(Exception e) {
        e.printStackTrace();
    }
}
gonzo33
  • 11
  • 2
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 20 '22 at 10:57