package io.netty.handler.codec.compression;

import com.jcraft.jzlib.Inflater;
import com.jcraft.jzlib.JZlib;

/* JADX INFO: loaded from: classes.dex */
public class JZlibDecoder extends ZlibDecoder {
    private byte[] dictionary;
    private volatile boolean finished;
    private final Inflater z;

    public JZlibDecoder() {
        this(ZlibWrapper.ZLIB);
    }

    /* JADX WARN: Code restructure failed: missing block: B:31:0x00ba, code lost:
    
        r8.finished = true;
        r8.z.inflateEnd();
     */
    @Override // io.netty.handler.codec.ByteToMessageDecoder
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    protected void decode(io.netty.channel.ChannelHandlerContext r9, io.netty.buffer.ByteBuf r10, java.util.List<java.lang.Object> r11) throws java.lang.Exception {
        /*
            Method dump skipped, instruction units count: 265
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: io.netty.handler.codec.compression.JZlibDecoder.decode(io.netty.channel.ChannelHandlerContext, io.netty.buffer.ByteBuf, java.util.List):void");
    }

    @Override // io.netty.handler.codec.compression.ZlibDecoder
    public boolean isClosed() {
        return this.finished;
    }

    public JZlibDecoder(ZlibWrapper zlibWrapper) {
        Inflater inflater = new Inflater();
        this.z = inflater;
        if (zlibWrapper == null) {
            throw new NullPointerException("wrapper");
        }
        int iInit = inflater.init(ZlibUtil.convertWrapperType(zlibWrapper));
        if (iInit != 0) {
            ZlibUtil.fail(this.z, "initialization failure", iInit);
        }
    }

    public JZlibDecoder(byte[] bArr) {
        Inflater inflater = new Inflater();
        this.z = inflater;
        if (bArr != null) {
            this.dictionary = bArr;
            int iInflateInit = inflater.inflateInit(JZlib.W_ZLIB);
            if (iInflateInit != 0) {
                ZlibUtil.fail(this.z, "initialization failure", iInflateInit);
                return;
            }
            return;
        }
        throw new NullPointerException("dictionary");
    }
}
