I am getting the error "ZipException: Invalid Block lengths" when reading a ZipInputStream from my java code.
My zip file oppens and is extracted normally with my Zip file utility from windows, so it is not corrupted.
The first entry inside the zip file is an empty directory named "." (is a zip file generated from other system that I don't have access to). When the code tries to get the next entry after the the "." directory, the exception is thrown.
I am getting this file from a SQL Database and don't want to store it in my file system before reading. Here is my code:
try{
ZipEntry ze = null;
while((ze = zin.getNextEntry()) != null){ //zin is the ZipInputStream
if(!ze.isDirectory()){
// DO SOMETHING WITH THE FILE
}
}
} catch (ZipException ex){
# EXCEPTION THROWN
} finally {
zin.close();
}