Currently, when trying to read a ZIP file, I cannot differentiate between an empty ZIP file and a corrupted/illegal ZIP file, as in both cases, the following while
loop is never going to run:
ZipInputStream zis = new ZipInputStream(bais);
ZipEntry ze = null;
boolean hasContent = false;
while ((ze = zis.getNextEntry()) != null) {
hasContent = true;
}
Is there a way to differentiate between empty file and illegal/corrupted file?