0

I have some concurrency problems with ZipInputStream and I found that it is not safe thread. Do you know any alternative which is threaded safe?

Thank you

  • I'm struggling to think of a scenario where you would have to write to a zip file concurrently from multiple threads. – SeverityOne May 18 '18 at 19:18
  • *All* streams are thread-unsafe in this sense. Use a separate one per thread, or sequentialize your code. – user207421 May 18 '18 at 21:41

1 Answers1

0

Well You will search for everyplace for a Thread Safe for a ZipInputStream. But the downside of this that none of the InputStream implementations in Java are thread-safe. The only way of doing this is Synch your code for only a Thread access the file that you want.

Gatusko
  • 2,503
  • 1
  • 17
  • 25