On 10/05/2013 23:48, Xueming Shen wrote:
:

So the proposed fix is more a workaround for this available() issue. The
alternative is to fix the issue directly, for example, to change the ZIS's
available implementation to something like

    public int available() throws IOException {
        ensureOpen();
        if (entryEOF || entry == null)
            return 0;
        switch (entry.method) {
        case DEFLATED:
            return (inf.finished() || inf.needsDictionary()) ? 0 : 1;
        case STORED:
            return remaining > 0 ? 1 : 0;
        default:
            throw new ZipException("invalid compression method");
        }
    }

we probably should go further to simply remove the flag "entryEOF"
and move the "deflated" case implementation into InflaterInputStream
(to fix 7031075 as well).

Just catching up on this thread now. I agree the proposed patch is really a workaround and we should fix the real issue. The ZIS.available method that you propose looks fine for a first fix but it would be good to sort out 7031075 while we are in the area.

-Alan.

Reply via email to