package io.netty.handler.codec.http2;

import g.a.a.a.a;
import io.netty.buffer.ByteBuf;
import io.netty.handler.codec.http2.HpackUtil;
import io.netty.handler.codec.http2.Http2Headers;
import io.netty.handler.codec.memcache.binary.BinaryMemcacheOpcodes;
import io.netty.handler.codec.memcache.binary.DefaultBinaryMemcacheRequest;
import io.netty.util.AsciiString;
import io.netty.util.internal.ObjectUtil;
import io.netty.util.internal.ThrowableUtil;
import kotlinx.serialization.json.internal.AbstractJsonLexerKt;

/* JADX INFO: loaded from: classes.dex */
public final class HpackDecoder {
    public static final /* synthetic */ boolean $assertionsDisabled = false;
    private static final Http2Exception DECODE_ILLEGAL_INDEX_VALUE;
    private static final Http2Exception DECODE_ULE_128_DECOMPRESSION_EXCEPTION;
    private static final Http2Exception DECODE_ULE_128_TO_INT_DECOMPRESSION_EXCEPTION;
    private static final Http2Exception DECODE_ULE_128_TO_LONG_DECOMPRESSION_EXCEPTION;
    private static final Http2Exception INDEX_HEADER_ILLEGAL_INDEX_VALUE;
    private static final Http2Exception INVALID_MAX_DYNAMIC_TABLE_SIZE;
    private static final Http2Exception MAX_DYNAMIC_TABLE_SIZE_CHANGE_REQUIRED;
    private static final byte READ_HEADER_REPRESENTATION = 0;
    private static final byte READ_INDEXED_HEADER = 2;
    private static final byte READ_INDEXED_HEADER_NAME = 3;
    private static final byte READ_LITERAL_HEADER_NAME = 6;
    private static final byte READ_LITERAL_HEADER_NAME_LENGTH = 5;
    private static final byte READ_LITERAL_HEADER_NAME_LENGTH_PREFIX = 4;
    private static final byte READ_LITERAL_HEADER_VALUE = 9;
    private static final byte READ_LITERAL_HEADER_VALUE_LENGTH = 8;
    private static final byte READ_LITERAL_HEADER_VALUE_LENGTH_PREFIX = 7;
    private static final byte READ_MAX_DYNAMIC_TABLE_SIZE = 1;
    private static final Http2Exception READ_NAME_ILLEGAL_INDEX_VALUE;
    private long encoderMaxDynamicTableSize;
    private final HpackDynamicTable hpackDynamicTable;
    private final HpackHuffmanDecoder hpackHuffmanDecoder;
    private long maxDynamicTableSize;
    private boolean maxDynamicTableSizeChangeRequired;
    private long maxHeaderListSize;
    private long maxHeaderListSizeGoAway;

    /* JADX INFO: renamed from: io.netty.handler.codec.http2.HpackDecoder$1, reason: invalid class name */
    public static /* synthetic */ class AnonymousClass1 {
        public static final /* synthetic */ int[] $SwitchMap$io$netty$handler$codec$http2$HpackUtil$IndexType;

        static {
            HpackUtil.IndexType.values();
            int[] iArr = new int[3];
            $SwitchMap$io$netty$handler$codec$http2$HpackUtil$IndexType = iArr;
            try {
                iArr[HpackUtil.IndexType.NONE.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                $SwitchMap$io$netty$handler$codec$http2$HpackUtil$IndexType[HpackUtil.IndexType.NEVER.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                $SwitchMap$io$netty$handler$codec$http2$HpackUtil$IndexType[HpackUtil.IndexType.INCREMENTAL.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
        }
    }

    public enum HeaderType {
        REGULAR_HEADER,
        REQUEST_PSEUDO_HEADER,
        RESPONSE_PSEUDO_HEADER
    }

    static {
        Http2Error http2Error = Http2Error.COMPRESSION_ERROR;
        DECODE_ULE_128_DECOMPRESSION_EXCEPTION = (Http2Exception) ThrowableUtil.unknownStackTrace(Http2Exception.connectionError(http2Error, "HPACK - decompression failure", new Object[0]), HpackDecoder.class, "decodeULE128(..)");
        DECODE_ULE_128_TO_LONG_DECOMPRESSION_EXCEPTION = (Http2Exception) ThrowableUtil.unknownStackTrace(Http2Exception.connectionError(http2Error, "HPACK - long overflow", new Object[0]), HpackDecoder.class, "decodeULE128(..)");
        DECODE_ULE_128_TO_INT_DECOMPRESSION_EXCEPTION = (Http2Exception) ThrowableUtil.unknownStackTrace(Http2Exception.connectionError(http2Error, "HPACK - int overflow", new Object[0]), HpackDecoder.class, "decodeULE128ToInt(..)");
        DECODE_ILLEGAL_INDEX_VALUE = (Http2Exception) ThrowableUtil.unknownStackTrace(Http2Exception.connectionError(http2Error, "HPACK - illegal index value", new Object[0]), HpackDecoder.class, "decode(..)");
        INDEX_HEADER_ILLEGAL_INDEX_VALUE = (Http2Exception) ThrowableUtil.unknownStackTrace(Http2Exception.connectionError(http2Error, "HPACK - illegal index value", new Object[0]), HpackDecoder.class, "indexHeader(..)");
        READ_NAME_ILLEGAL_INDEX_VALUE = (Http2Exception) ThrowableUtil.unknownStackTrace(Http2Exception.connectionError(http2Error, "HPACK - illegal index value", new Object[0]), HpackDecoder.class, "readName(..)");
        INVALID_MAX_DYNAMIC_TABLE_SIZE = (Http2Exception) ThrowableUtil.unknownStackTrace(Http2Exception.connectionError(http2Error, "HPACK - invalid max dynamic table size", new Object[0]), HpackDecoder.class, "setDynamicTableSize(..)");
        MAX_DYNAMIC_TABLE_SIZE_CHANGE_REQUIRED = (Http2Exception) ThrowableUtil.unknownStackTrace(Http2Exception.connectionError(http2Error, "HPACK - max dynamic table size change required", new Object[0]), HpackDecoder.class, "decode(..)");
    }

    public HpackDecoder(long j2, int i2) {
        this(j2, i2, 4096);
    }

    public HpackDecoder(long j2, int i2, int i3) {
        this.maxHeaderListSize = ObjectUtil.checkPositive(j2, "maxHeaderListSize");
        this.maxHeaderListSizeGoAway = Http2CodecUtil.calculateMaxHeaderListSizeGoAway(j2);
        long j3 = i3;
        this.encoderMaxDynamicTableSize = j3;
        this.maxDynamicTableSize = j3;
        this.maxDynamicTableSizeChangeRequired = false;
        this.hpackDynamicTable = new HpackDynamicTable(j3);
        this.hpackHuffmanDecoder = new HpackHuffmanDecoder(i2);
    }

    private long addHeader(Http2Headers http2Headers, CharSequence charSequence, CharSequence charSequence2, long j2) throws Http2Exception {
        long jSizeOf = HpackHeaderField.sizeOf(charSequence, charSequence2) + j2;
        long j3 = this.maxHeaderListSizeGoAway;
        if (jSizeOf > j3) {
            Http2CodecUtil.headerListSizeExceeded(j3);
        }
        http2Headers.add(charSequence, charSequence2);
        return jSizeOf;
    }

    public static int decodeULE128(ByteBuf byteBuf, int i2) throws Http2Exception {
        int i3 = byteBuf.readerIndex();
        long jDecodeULE128 = decodeULE128(byteBuf, i2);
        if (jDecodeULE128 <= 2147483647L) {
            return (int) jDecodeULE128;
        }
        byteBuf.readerIndex(i3);
        throw DECODE_ULE_128_TO_INT_DECOMPRESSION_EXCEPTION;
    }

    public static long decodeULE128(ByteBuf byteBuf, long j2) throws Http2Exception {
        int i2 = 0;
        boolean z2 = j2 == 0;
        int iWriterIndex = byteBuf.writerIndex();
        int i3 = byteBuf.readerIndex();
        while (i3 < iWriterIndex) {
            byte b2 = byteBuf.getByte(i3);
            if (i2 == 56 && ((b2 & DefaultBinaryMemcacheRequest.REQUEST_MAGIC_BYTE) != 0 || (b2 == 127 && !z2))) {
                throw DECODE_ULE_128_TO_LONG_DECOMPRESSION_EXCEPTION;
            }
            if ((b2 & DefaultBinaryMemcacheRequest.REQUEST_MAGIC_BYTE) == 0) {
                byteBuf.readerIndex(i3 + 1);
                return j2 + ((((long) b2) & 127) << i2);
            }
            j2 += (((long) b2) & 127) << i2;
            i3++;
            i2 += 7;
        }
        throw DECODE_ULE_128_DECOMPRESSION_EXCEPTION;
    }

    private HpackHeaderField getIndexedHeader(int i2) throws Http2Exception {
        int i3 = HpackStaticTable.length;
        if (i2 <= i3) {
            return HpackStaticTable.getEntry(i2);
        }
        if (i2 - i3 <= this.hpackDynamicTable.length()) {
            return this.hpackDynamicTable.getEntry(i2 - i3);
        }
        throw INDEX_HEADER_ILLEGAL_INDEX_VALUE;
    }

    private long insertHeader(Http2Headers http2Headers, CharSequence charSequence, CharSequence charSequence2, HpackUtil.IndexType indexType, long j2) throws Http2Exception {
        long jAddHeader = addHeader(http2Headers, charSequence, charSequence2, j2);
        int iOrdinal = indexType.ordinal();
        if (iOrdinal == 0) {
            this.hpackDynamicTable.add(new HpackHeaderField(charSequence, charSequence2));
        } else if (iOrdinal != 1 && iOrdinal != 2) {
            throw new Error("should not reach here");
        }
        return jAddHeader;
    }

    private static IllegalArgumentException notEnoughDataException(ByteBuf byteBuf) {
        return new IllegalArgumentException("decode only works with an entire header block! " + byteBuf);
    }

    private CharSequence readName(int i2) throws Http2Exception {
        HpackHeaderField entry;
        int i3 = HpackStaticTable.length;
        if (i2 <= i3) {
            entry = HpackStaticTable.getEntry(i2);
        } else {
            if (i2 - i3 > this.hpackDynamicTable.length()) {
                throw READ_NAME_ILLEGAL_INDEX_VALUE;
            }
            entry = this.hpackDynamicTable.getEntry(i2 - i3);
        }
        return entry.name;
    }

    private CharSequence readStringLiteral(ByteBuf byteBuf, int i2, boolean z2) {
        if (z2) {
            return this.hpackHuffmanDecoder.decode(byteBuf, i2);
        }
        byte[] bArr = new byte[i2];
        byteBuf.readBytes(bArr);
        return new AsciiString(bArr, false);
    }

    private void setDynamicTableSize(long j2) throws Http2Exception {
        if (j2 > this.maxDynamicTableSize) {
            throw INVALID_MAX_DYNAMIC_TABLE_SIZE;
        }
        this.encoderMaxDynamicTableSize = j2;
        this.maxDynamicTableSizeChangeRequired = false;
        this.hpackDynamicTable.setCapacity(j2);
    }

    private HeaderType validate(CharSequence charSequence, HeaderType headerType, boolean z2) throws Http2Exception {
        if (!z2) {
            return null;
        }
        if (!Http2Headers.PseudoHeaderName.hasPseudoHeaderFormat(charSequence)) {
            return HeaderType.REGULAR_HEADER;
        }
        if (headerType == HeaderType.REGULAR_HEADER) {
            throw Http2Exception.connectionError(Http2Error.PROTOCOL_ERROR, "Pseudo-header field '%s' found after regular header.", charSequence);
        }
        Http2Headers.PseudoHeaderName pseudoHeader = Http2Headers.PseudoHeaderName.getPseudoHeader(charSequence);
        if (pseudoHeader == null) {
            throw Http2Exception.connectionError(Http2Error.PROTOCOL_ERROR, "Invalid HTTP/2 pseudo-header '%s' encountered.", charSequence);
        }
        HeaderType headerType2 = pseudoHeader.isRequestOnly() ? HeaderType.REQUEST_PSEUDO_HEADER : HeaderType.RESPONSE_PSEUDO_HEADER;
        if (headerType == null || headerType2 == headerType) {
            return headerType2;
        }
        throw Http2Exception.connectionError(Http2Error.PROTOCOL_ERROR, "Mix of request and response pseudo-headers.", new Object[0]);
    }

    public void decode(int i2, ByteBuf byteBuf, Http2Headers http2Headers, boolean z2) throws Http2Exception {
        HpackUtil.IndexType indexType;
        boolean z3;
        long jDecodeULE128;
        HeaderType headerTypeValidate;
        long jAddHeader;
        CharSequence name;
        boolean z4;
        int i3;
        int i4;
        CharSequence charSequence;
        int i5;
        HpackUtil.IndexType indexType2;
        int i6;
        ByteBuf byteBuf2 = byteBuf;
        HeaderType headerTypeValidate2 = null;
        int i7 = 0;
        int length = 0;
        int i8 = 0;
        int i9 = 0;
        HpackUtil.IndexType indexType3 = HpackUtil.IndexType.NONE;
        long jAddHeader2 = 0;
        boolean z5 = false;
        CharSequence charSequence2 = null;
        while (byteBuf.isReadable()) {
            switch (i9) {
                case 0:
                    indexType = indexType3;
                    z3 = z5;
                    byte b2 = byteBuf.readByte();
                    if (this.maxDynamicTableSizeChangeRequired && (b2 & 224) != 32) {
                        throw MAX_DYNAMIC_TABLE_SIZE_CHANGE_REQUIRED;
                    }
                    if (b2 >= 0) {
                        if ((b2 & 64) == 64) {
                            indexType2 = HpackUtil.IndexType.INCREMENTAL;
                            i6 = b2 & 63;
                            if (i6 == 0) {
                                i8 = i6;
                                i9 = 4;
                                byteBuf2 = byteBuf;
                                z5 = z3;
                                indexType3 = indexType2;
                            } else if (i6 == 63) {
                                i8 = i6;
                                i9 = 3;
                                byteBuf2 = byteBuf;
                                z5 = z3;
                                indexType3 = indexType2;
                            } else {
                                i8 = i6;
                                name = readName(i8);
                                indexType = indexType2;
                                headerTypeValidate2 = validate(name, headerTypeValidate2, z2);
                                charSequence2 = name;
                                length = name.length();
                                i9 = 7;
                                byteBuf2 = byteBuf;
                                z5 = z3;
                            }
                            break;
                        } else if ((b2 & 32) != 32) {
                            indexType2 = (b2 & 16) == 16 ? HpackUtil.IndexType.NEVER : HpackUtil.IndexType.NONE;
                            i6 = b2 & BinaryMemcacheOpcodes.PREPEND;
                            if (i6 == 0) {
                                i8 = i6;
                                i9 = 4;
                                byteBuf2 = byteBuf;
                                z5 = z3;
                                indexType3 = indexType2;
                            } else if (i6 == 15) {
                                i8 = i6;
                                i9 = 3;
                                byteBuf2 = byteBuf;
                                z5 = z3;
                                indexType3 = indexType2;
                            } else {
                                i8 = i6;
                                name = readName(i8);
                                indexType = indexType2;
                                headerTypeValidate2 = validate(name, headerTypeValidate2, z2);
                                charSequence2 = name;
                                length = name.length();
                                i9 = 7;
                                byteBuf2 = byteBuf;
                                z5 = z3;
                            }
                            break;
                        } else {
                            i8 = b2 & 31;
                            if (i8 == 31) {
                                z5 = z3;
                                i9 = 1;
                                byteBuf2 = byteBuf;
                            } else {
                                jDecodeULE128 = i8;
                                setDynamicTableSize(jDecodeULE128);
                                z5 = z3;
                                i9 = 0;
                                byteBuf2 = byteBuf;
                            }
                        }
                        indexType3 = indexType;
                    } else {
                        int i10 = b2 & AbstractJsonLexerKt.TC_INVALID;
                        if (i10 == 0) {
                            throw DECODE_ILLEGAL_INDEX_VALUE;
                        }
                        if (i10 != 127) {
                            HpackHeaderField indexedHeader = getIndexedHeader(i10);
                            HeaderType headerTypeValidate3 = validate(indexedHeader.name, headerTypeValidate2, z2);
                            jAddHeader2 = addHeader(http2Headers, indexedHeader.name, indexedHeader.value, jAddHeader2);
                            i5 = i9;
                            headerTypeValidate2 = headerTypeValidate3;
                        } else {
                            i5 = 2;
                        }
                        i4 = i5;
                        i3 = i10;
                        z4 = z3;
                        i9 = i4;
                        i8 = i3;
                        z5 = z4;
                        byteBuf2 = byteBuf;
                        indexType3 = indexType;
                    }
                    break;
                    break;
                case 1:
                    indexType = indexType3;
                    z3 = z5;
                    jDecodeULE128 = decodeULE128(byteBuf2, i8);
                    setDynamicTableSize(jDecodeULE128);
                    z5 = z3;
                    i9 = 0;
                    byteBuf2 = byteBuf;
                    indexType3 = indexType;
                    break;
                case 2:
                    indexType = indexType3;
                    HpackHeaderField indexedHeader2 = getIndexedHeader(decodeULE128(byteBuf2, i8));
                    headerTypeValidate = validate(indexedHeader2.name, headerTypeValidate2, z2);
                    z3 = z5;
                    jAddHeader = addHeader(http2Headers, indexedHeader2.name, indexedHeader2.value, jAddHeader2);
                    jAddHeader2 = jAddHeader;
                    headerTypeValidate2 = headerTypeValidate;
                    z5 = z3;
                    i9 = 0;
                    byteBuf2 = byteBuf;
                    indexType3 = indexType;
                    break;
                case 3:
                    indexType = indexType3;
                    name = readName(decodeULE128(byteBuf2, i8));
                    z3 = z5;
                    headerTypeValidate2 = validate(name, headerTypeValidate2, z2);
                    charSequence2 = name;
                    length = name.length();
                    i9 = 7;
                    byteBuf2 = byteBuf;
                    z5 = z3;
                    indexType3 = indexType;
                    break;
                case 4:
                    indexType = indexType3;
                    byte b3 = byteBuf.readByte();
                    z4 = (b3 & DefaultBinaryMemcacheRequest.REQUEST_MAGIC_BYTE) == 128;
                    i3 = b3 & AbstractJsonLexerKt.TC_INVALID;
                    if (i3 != 127) {
                        long j2 = i3;
                        long j3 = this.maxHeaderListSizeGoAway;
                        if (j2 > j3 - jAddHeader2) {
                            Http2CodecUtil.headerListSizeExceeded(j3);
                        }
                        length = i3;
                        i8 = length;
                        z5 = z4;
                        i9 = 6;
                        indexType3 = indexType;
                    } else {
                        i4 = 5;
                        i9 = i4;
                        i8 = i3;
                        z5 = z4;
                        byteBuf2 = byteBuf;
                        indexType3 = indexType;
                    }
                    break;
                case 5:
                    indexType = indexType3;
                    int iDecodeULE128 = decodeULE128(byteBuf2, i8);
                    long j4 = iDecodeULE128;
                    boolean z6 = z5;
                    long j5 = this.maxHeaderListSizeGoAway;
                    if (j4 > j5 - jAddHeader2) {
                        Http2CodecUtil.headerListSizeExceeded(j5);
                    }
                    length = iDecodeULE128;
                    z5 = z6;
                    i9 = 6;
                    indexType3 = indexType;
                    break;
                case 6:
                    boolean z7 = z5;
                    indexType = indexType3;
                    if (byteBuf.readableBytes() < length) {
                        throw notEnoughDataException(byteBuf);
                    }
                    CharSequence stringLiteral = readStringLiteral(byteBuf2, length, z7);
                    headerTypeValidate2 = validate(stringLiteral, headerTypeValidate2, z2);
                    charSequence2 = stringLiteral;
                    z3 = z7;
                    i9 = 7;
                    byteBuf2 = byteBuf;
                    z5 = z3;
                    indexType3 = indexType;
                    break;
                    break;
                case 7:
                    indexType = indexType3;
                    byte b4 = byteBuf.readByte();
                    z4 = (b4 & DefaultBinaryMemcacheRequest.REQUEST_MAGIC_BYTE) == 128;
                    i3 = b4 & AbstractJsonLexerKt.TC_INVALID;
                    if (i3 == 0) {
                        z3 = z4;
                        headerTypeValidate = validate(charSequence2, headerTypeValidate2, z2);
                        charSequence = AsciiString.EMPTY_STRING;
                        i8 = i3;
                        jAddHeader = insertHeader(http2Headers, charSequence2, charSequence, indexType, jAddHeader2);
                        jAddHeader2 = jAddHeader;
                        headerTypeValidate2 = headerTypeValidate;
                        z5 = z3;
                        i9 = 0;
                        byteBuf2 = byteBuf;
                        indexType3 = indexType;
                    } else if (i3 == 127) {
                        i4 = 8;
                        i9 = i4;
                        i8 = i3;
                        z5 = z4;
                        byteBuf2 = byteBuf;
                        indexType3 = indexType;
                    } else {
                        long j6 = ((long) i3) + ((long) length);
                        long j7 = this.maxHeaderListSizeGoAway;
                        if (j6 > j7 - jAddHeader2) {
                            Http2CodecUtil.headerListSizeExceeded(j7);
                        }
                        z5 = z4;
                        i7 = i3;
                        i8 = i7;
                        i9 = 9;
                        indexType3 = indexType;
                    }
                    break;
                case 8:
                    int iDecodeULE1282 = decodeULE128(byteBuf2, i8);
                    indexType = indexType3;
                    boolean z8 = z5;
                    long j8 = ((long) iDecodeULE1282) + ((long) length);
                    long j9 = this.maxHeaderListSizeGoAway;
                    if (j8 > j9 - jAddHeader2) {
                        Http2CodecUtil.headerListSizeExceeded(j9);
                    }
                    i7 = iDecodeULE1282;
                    z5 = z8;
                    i9 = 9;
                    indexType3 = indexType;
                    break;
                case 9:
                    if (byteBuf.readableBytes() < i7) {
                        throw notEnoughDataException(byteBuf);
                    }
                    CharSequence stringLiteral2 = readStringLiteral(byteBuf2, i7, z5);
                    headerTypeValidate = validate(charSequence2, headerTypeValidate2, z2);
                    indexType = indexType3;
                    z3 = z5;
                    charSequence = stringLiteral2;
                    jAddHeader = insertHeader(http2Headers, charSequence2, charSequence, indexType, jAddHeader2);
                    jAddHeader2 = jAddHeader;
                    headerTypeValidate2 = headerTypeValidate;
                    z5 = z3;
                    i9 = 0;
                    byteBuf2 = byteBuf;
                    indexType3 = indexType;
                    break;
                    break;
                default:
                    throw new Error(a.l("should not reach here state: ", i9));
            }
        }
        int i11 = i9;
        long j10 = this.maxHeaderListSize;
        if (jAddHeader2 > j10) {
            Http2CodecUtil.headerListSizeExceeded(i2, j10, true);
        }
        if (i11 != 0) {
            throw Http2Exception.connectionError(Http2Error.COMPRESSION_ERROR, "Incomplete header block fragment.", new Object[0]);
        }
    }

    public HpackHeaderField getHeaderField(int i2) {
        return this.hpackDynamicTable.getEntry(i2 + 1);
    }

    public long getMaxHeaderListSize() {
        return this.maxHeaderListSize;
    }

    public long getMaxHeaderListSizeGoAway() {
        return this.maxHeaderListSizeGoAway;
    }

    public long getMaxHeaderTableSize() {
        return this.hpackDynamicTable.capacity();
    }

    public int length() {
        return this.hpackDynamicTable.length();
    }

    public void setMaxHeaderListSize(long j2, long j3) throws Http2Exception {
        if (j3 < j2 || j3 < 0) {
            throw Http2Exception.connectionError(Http2Error.INTERNAL_ERROR, "Header List Size GO_AWAY %d must be positive and >= %d", Long.valueOf(j3), Long.valueOf(j2));
        }
        if (j2 < 0 || j2 > 4294967295L) {
            throw Http2Exception.connectionError(Http2Error.PROTOCOL_ERROR, "Header List Size must be >= %d and <= %d but was %d", 0L, 4294967295L, Long.valueOf(j2));
        }
        this.maxHeaderListSize = j2;
        this.maxHeaderListSizeGoAway = j3;
    }

    public void setMaxHeaderTableSize(long j2) throws Http2Exception {
        if (j2 < 0 || j2 > 4294967295L) {
            throw Http2Exception.connectionError(Http2Error.PROTOCOL_ERROR, "Header Table Size must be >= %d and <= %d but was %d", 0L, 4294967295L, Long.valueOf(j2));
        }
        this.maxDynamicTableSize = j2;
        if (j2 < this.encoderMaxDynamicTableSize) {
            this.maxDynamicTableSizeChangeRequired = true;
            this.hpackDynamicTable.setCapacity(j2);
        }
    }

    public long size() {
        return this.hpackDynamicTable.size();
    }
}
