You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The example is using ZipFile from a ZipFile stream recursevly. This cannot be done from a ZipInputStream, since, like the error message says, it does not support seeking.
The real question is how can I recursively open and decompress zips. I never need these to be actual files and I am parsing the contents directly from the stream and storing in a database.
Sorry, I misread your initial issue. The stream returned from ZipFile.GetInputStream is only seekable if it's not compressed. I'm not sure why there is an example that explicitly does this.
Perhaps it could be done by using ZipInputStream instead of ZipFile, but I have not tried it.
Steps to reproduce
1.Open a zipfile
2.loop over till find a ZipEntry that is a zip file.
3. Stream s = zipfile.GetInputStream(zipEntry)
4. newZipFile = new ZipFile(s);
Expected behavior
Should open and process (by your example at https://github.com/icsharpcode/SharpZipLib/wiki/Unpack-a-Zip%2C-including-embedded-zips%2C-and-re-pack-into-a-new-zip-or-memorystream)
Actual behavior
Exception that says the stream is not seekable. The stacktrace shows that the exception is right in the ZipFile constructor.
Version of SharpZipLib 1.3.2
Obtained from (only keep the relevant lines)
The text was updated successfully, but these errors were encountered: