package okhttp3.internal.http2; import java.util.Arrays; import o.C14953gcr; import o.C14957gcv; /* loaded from: classes.dex */ public final class Settings { public static final int COUNT = 10; public static final Companion Companion = new Companion(null); public static final int DEFAULT_INITIAL_WINDOW_SIZE = 65535; public static final int ENABLE_PUSH = 2; public static final int HEADER_TABLE_SIZE = 1; public static final int INITIAL_WINDOW_SIZE = 7; public static final int MAX_CONCURRENT_STREAMS = 4; public static final int MAX_FRAME_SIZE = 5; public static final int MAX_HEADER_LIST_SIZE = 6; private int set; private final int[] values = new int[10]; public final int getHeaderTableSize() { if ((this.set & 2) != 0) { return this.values[1]; } return -1; } public final int getInitialWindowSize() { if ((this.set & 128) != 0) { return this.values[7]; } return 65535; } public final Settings set(int i, int i2) { if (i >= 0) { int[] iArr = this.values; if (i < iArr.length) { this.set = (1 << i) | this.set; iArr[i] = i2; } } return this; } public final int get(int i) { return this.values[i]; } public final int size() { return Integer.bitCount(this.set); } public final boolean getEnablePush(boolean z) { return (this.set & 4) != 0 ? this.values[2] == 1 : z; } public final int getMaxConcurrentStreams() { if ((this.set & 16) != 0) { return this.values[4]; } return Integer.MAX_VALUE; } public final int getMaxFrameSize(int i) { return (this.set & 32) != 0 ? this.values[5] : i; } public final int getMaxHeaderListSize(int i) { return (this.set & 64) != 0 ? this.values[6] : i; } public final void merge(Settings settings) { C14957gcv.e(settings, ""); for (int i = 0; i < 10; i++) { if (settings.isSet(i)) { set(i, settings.get(i)); } } } /* loaded from: classes.dex */ public static final class Companion { private Companion() { } public /* synthetic */ Companion(C14953gcr c14953gcr) { this(); } } public final void clear() { this.set = 0; int[] iArr = this.values; int length = iArr.length; C14957gcv.e(iArr, ""); Arrays.fill(iArr, 0, length, 0); } public final boolean isSet(int i) { return ((1 << i) & this.set) != 0; } }