Skip to content
Advertisement

Random “Unexpected end of Zlib input stream” exception when trying to gunzip files

I have a class that is supposed to extract a given tar.gz file into a simple .tar file. But for some files this exception is thrown :

JavaScript

The method managing the extraction look like this :

JavaScript

The strange thing is that the exception is thrown for some files and sometimes it does not, but I can’t figure out why… 🙁

Am I missing something ?

Many thanks,

Advertisement

Answer

The error was due to a concurrent access to the file by another thread.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement