Uploaded image for project: 'Commons Compress'
  1. Commons Compress
  2. COMPRESS-618

Make ZipFile thread safe

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.21
    • None
    • Archivers
    • None

    Description

      Sorry if another issue already exists for this, I couldn't find one. When I enable the ignoreLocalFileHeader constructor flag, I started to get BufferOverflowException/BufferUnderFlowException while calling ZipFile.getInputStream(ZipArchiveEntry). Looking at the code, there is some local instances of byte[] and ByteBuffer reused by some private methods that should be the cause of those exceptions. Everything seems fine if ignoreLocalFileHeader is false, but I need to open very large zip files as fast as possible. If I synchronize on ZipFile.getInputStream(ze), it seems to workaround. Actually, I don't know if ZipFile was designed to be thread safe, but it would be nice to be. I also saw some synchronization code in BoundedSeekableByteChannelInputStream class, so not sure if this issue is an enhancement or bug report...

      Attachments

        Activity

          People

            Unassigned Unassigned
            lfcnassif Luís Filipe Nassif
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: