Details
Description
I'm trying to use ZipArchiveInputStream to iterate over the items of a zip file (which may or may not be a real file on the file-system, which is why I use a stream), optionally creating a stream from specific entries.
One of the operations I need is to get the size of the files within.
For some reason, it fails to do so. Not only that, but it throws an exception when I'm done with it:
Error:org.apache.commons.compress.archivers.zip.UnsupportedZipFeatureException: Unsupported feature data descriptor used in entry ...
I've attached here 3 files:sample project, the problematic zip file (remember that you need to put it in the correct path and grant storage permission), and a screenshot of the issue.
Note that if I open the file using a third party PC app (such as 7-zip ), it works fine, including showing the file size inside.
Files:
Here's the relevant code (kotlin) :
thread { try { val file = File("/storage/emulated/0/test.zip") ZipArchiveInputStream(FileInputStream(file)).use { while (true) { val entry = it.nextEntry ?: break Log.d("AppLog", "entry:${entry.name} ${entry.size} ") } } Log.d("AppLog", "got archive ") } catch (e: Exception) { Log.d("AppLog", "Error:$e") e.printStackTrace() } }