package defpackage;

import com.google.android.gms.internal.measurement.zzacy;
import java.util.Locale;

/* JADX INFO: renamed from: ᵡᴵʽˈ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C3210 extends AbstractC0857 {

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final byte[] f12231;

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public int f12232;

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public final int f12233;

    public C3210(int i, byte[] bArr) {
        int length = bArr.length;
        if (((length - i) | i) < 0) {
            Locale locale = Locale.US;
            ᵕᵩʽᵲ.ᵮᵣᵗˈ(AbstractC3653.m8230(length, i, "Array range is invalid. Buffer.length=", ", offset=0, length="));
            throw null;
        }
        this.f12231 = bArr;
        this.f12232 = 0;
        this.f12233 = i;
    }

    @Override // defpackage.AbstractC0857
    /* JADX INFO: renamed from: ˉᵲ */
    public final void mo2043(int i) throws zzacy {
        int i2 = this.f12232;
        try {
            byte[] bArr = this.f12231;
            bArr[i2] = (byte) i;
            bArr[i2 + 1] = (byte) (i >> 8);
            bArr[i2 + 2] = (byte) (i >> 16);
            bArr[i2 + 3] = (byte) (i >> 24);
            this.f12232 = i2 + 4;
        } catch (IndexOutOfBoundsException e) {
            throw new zzacy(i2, this.f12233, 4, e);
        }
    }

    @Override // defpackage.AbstractC0857
    /* JADX INFO: renamed from: ˊᵙᵾᵲ */
    public final void mo2044(int i) throws zzacy {
        int i2;
        int i3 = this.f12232;
        while (true) {
            int i4 = i & (-128);
            byte[] bArr = this.f12231;
            if (i4 == 0) {
                i2 = i3 + 1;
                bArr[i3] = (byte) i;
                this.f12232 = i2;
                return;
            } else {
                i2 = i3 + 1;
                try {
                    bArr[i3] = (byte) (i | 128);
                    i >>>= 7;
                    i3 = i2;
                } catch (IndexOutOfBoundsException e) {
                    throw new zzacy(i2, this.f12233, 1, e);
                }
            }
            throw new zzacy(i2, this.f12233, 1, e);
        }
    }

    @Override // defpackage.AbstractC0857
    /* JADX INFO: renamed from: ˊᵨᵧ */
    public final void mo2045(long j) throws zzacy {
        int i = this.f12232;
        try {
            byte[] bArr = this.f12231;
            bArr[i] = (byte) j;
            bArr[i + 1] = (byte) (j >> 8);
            bArr[i + 2] = (byte) (j >> 16);
            bArr[i + 3] = (byte) (j >> 24);
            bArr[i + 4] = (byte) (j >> 32);
            bArr[i + 5] = (byte) (j >> 40);
            bArr[i + 6] = (byte) (j >> 48);
            bArr[i + 7] = (byte) (j >> 56);
            this.f12232 = i + 8;
        } catch (IndexOutOfBoundsException e) {
            throw new zzacy(i, this.f12233, 8, e);
        }
    }

    @Override // defpackage.AbstractC0857
    /* JADX INFO: renamed from: ˊᵫᵗ */
    public final void mo2046(long j, int i) throws zzacy {
        mo2044(i << 3);
        mo2050(j);
    }

    @Override // defpackage.AbstractC0857
    /* JADX INFO: renamed from: ˋˈ */
    public final void mo2047(int i, byte[] bArr) throws zzacy {
        mo2044(i);
        m7352(bArr, 0, i);
    }

    @Override // defpackage.AbstractC0857
    /* JADX INFO: renamed from: ˌᴵ */
    public final void mo2048(String str) throws zzacy {
        int i = this.f12232;
        try {
            int iM3024 = AbstractC0857.m3024(str.length() * 3);
            int iM30242 = AbstractC0857.m3024(str.length());
            byte[] bArr = this.f12231;
            if (iM30242 != iM3024) {
                mo2044(AbstractC5355.m10942(str));
                int i2 = this.f12232;
                this.f12232 = AbstractC5355.m10943(str, bArr, i2, bArr.length - i2);
            } else {
                int i3 = i + iM30242;
                this.f12232 = i3;
                int iM10943 = AbstractC5355.m10943(str, bArr, i3, bArr.length - i3);
                this.f12232 = i;
                mo2044((iM10943 - i) - iM30242);
                this.f12232 = iM10943;
            }
        } catch (IndexOutOfBoundsException e) {
            throw new zzacy(e);
        }
    }

    @Override // defpackage.AbstractC0857
    /* JADX INFO: renamed from: ˏːˆ */
    public final void mo2050(long j) throws zzacy {
        int i;
        int i2 = this.f12232;
        byte[] bArr = this.f12231;
        int i3 = this.f12233;
        if (!AbstractC0857.f3798 || i3 - i2 < 10) {
            while ((j & (-128)) != 0) {
                int i4 = i2 + 1;
                try {
                    bArr[i2] = (byte) (((int) j) | 128);
                    j >>>= 7;
                    i2 = i4;
                } catch (IndexOutOfBoundsException e) {
                    e = e;
                    i = i4;
                    throw new zzacy(i, i3, 1, e);
                }
            }
            i = i2 + 1;
            try {
                bArr[i2] = (byte) j;
            } catch (IndexOutOfBoundsException e2) {
                e = e2;
                throw new zzacy(i, i3, 1, e);
            }
        } else {
            while ((j & (-128)) != 0) {
                AbstractC4609.m9717(bArr, i2, (byte) (((int) j) | 128));
                j >>>= 7;
                i2++;
            }
            i = i2 + 1;
            AbstractC4609.m9717(bArr, i2, (byte) j);
        }
        this.f12232 = i;
    }

    @Override // defpackage.AbstractC0857
    /* JADX INFO: renamed from: ːˏᵟᵯ */
    public final void mo2051(byte[] bArr, int i, int i2) throws zzacy {
        m7352(bArr, i, i2);
    }

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public final int m7351() {
        return this.f12233 - this.f12232;
    }

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public final void m7352(byte[] bArr, int i, int i2) throws zzacy {
        try {
            System.arraycopy(bArr, i, this.f12231, this.f12232, i2);
            this.f12232 += i2;
        } catch (IndexOutOfBoundsException e) {
            throw new zzacy(this.f12232, this.f12233, i2, e);
        }
    }

    @Override // defpackage.AbstractC0857
    /* JADX INFO: renamed from: ᵝᵶ */
    public final void mo2054(AbstractC4667 abstractC4667) throws zzacy {
        mo2044(abstractC4667.mo1614());
        abstractC4667.mo1618(this);
    }

    @Override // defpackage.AbstractC0857
    /* JADX INFO: renamed from: ᵟᵹᵙ */
    public final void mo2055(byte b) throws zzacy {
        int i = this.f12232;
        try {
            int i2 = i + 1;
            try {
                this.f12231[i] = b;
                this.f12232 = i2;
            } catch (IndexOutOfBoundsException e) {
                e = e;
                i = i2;
                throw new zzacy(i, this.f12233, 1, e);
            }
        } catch (IndexOutOfBoundsException e2) {
            e = e2;
        }
    }

    @Override // defpackage.AbstractC0857
    /* JADX INFO: renamed from: ᵨᵣ */
    public final void mo2056(int i, int i2) throws zzacy {
        mo2044(i << 3);
        mo2061(i2);
    }

    @Override // defpackage.AbstractC0857
    /* JADX INFO: renamed from: ᵪᵹᵥᵻ */
    public final void mo2058(AbstractC3365 abstractC3365) throws zzacy {
        AbstractC4729 abstractC4729 = (AbstractC4729) abstractC3365;
        mo2044(abstractC4729.m9880());
        abstractC4729.m9886(this);
    }

    @Override // defpackage.AbstractC0857
    /* JADX INFO: renamed from: ᵮᵣᵗˈ */
    public final void mo2059(int i, AbstractC4667 abstractC4667) throws zzacy {
        mo2044((i << 3) | 2);
        mo2054(abstractC4667);
    }

    @Override // defpackage.AbstractC0857
    /* JADX INFO: renamed from: ᵱʡˏ */
    public final void mo2061(int i) throws zzacy {
        if (i >= 0) {
            mo2044(i);
        } else {
            mo2050(i);
        }
    }

    @Override // defpackage.AbstractC0857
    /* JADX INFO: renamed from: ᵱᵽʡᵚ */
    public final void mo2062(int i, boolean z) throws zzacy {
        mo2044(i << 3);
        mo2055(z ? (byte) 1 : (byte) 0);
    }

    @Override // defpackage.AbstractC0857
    /* JADX INFO: renamed from: ᵵᵽ */
    public final void mo2063(int i, int i2) throws zzacy {
        mo2044((i << 3) | 5);
        mo2043(i2);
    }

    @Override // defpackage.AbstractC0857
    /* JADX INFO: renamed from: ᵶᵥᵝ */
    public final void mo2065(int i, String str) throws zzacy {
        mo2044((i << 3) | 2);
        mo2048(str);
    }

    @Override // defpackage.AbstractC0857
    /* JADX INFO: renamed from: ᵷᵺʾᵖ */
    public final void mo2066(int i, int i2) throws zzacy {
        mo2044((i << 3) | i2);
    }

    @Override // defpackage.AbstractC0857
    /* JADX INFO: renamed from: ᵻʽᵯ */
    public final void mo2067(long j, int i) throws zzacy {
        mo2044((i << 3) | 1);
        mo2045(j);
    }

    @Override // defpackage.AbstractC0857
    /* JADX INFO: renamed from: ᵻˈᵦʼ */
    public final void mo2068(int i, int i2) throws zzacy {
        mo2044(i << 3);
        mo2044(i2);
    }
}
