The class java.util.zip.ZipEntry
has a method getSize
that returns -1 if the uncompressed size is unknown.
I understand this can happen if I have a ZipInputStream
. Can this also happen if I have a ZipFile
?
I have code that reads a .zip
file and needs to know the uncompressed size of a zip entry, and I ask because I need to know whether I need to handle the case that getSize
returns -1.
If it is possible that getSize
returns -1, then I'd like to know how I should go about constructing such a .zip
file, so that I can write a test to confirm I'm handling it correctly.
ZipFile
is enough, but I'm still not sure. I posted a comment over there summarizing my findings. – Refreshment