package defpackage;

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

/* renamed from: ᵣʩᵔ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C3329 extends AbstractC4357 {

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public int f12424;

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final byte[] f12425;

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final int f12426;

    public C3329(int i, byte[] bArr) {
        int length = bArr.length;
        if (((length - i) | i) < 0) {
            Locale locale = Locale.US;
            ᵹˉᵞ.ˌᵜᵹᵩ(AbstractC1327.m4091(length, i, "Array range is invalid. Buffer.length=", ", offset=0, length="));
            throw null;
        }
        this.f12425 = bArr;
        this.f12424 = 0;
        this.f12426 = i;
    }

    @Override // defpackage.AbstractC4357
    /* renamed from: ˇʼʤˎ */
    public final void mo7248(int i, int i2) throws zzacy {
        mo7268(i << 3);
        mo7257(i2);
    }

    @Override // defpackage.AbstractC4357
    /* renamed from: ˌʾˀ */
    public final void mo7249(byte b) throws zzacy {
        int i = this.f12424;
        try {
            int i2 = i + 1;
            try {
                this.f12425[i] = b;
                this.f12424 = i2;
            } catch (IndexOutOfBoundsException e) {
                e = e;
                i = i2;
                throw new zzacy(i, this.f12426, 1, e);
            }
        } catch (IndexOutOfBoundsException e2) {
            e = e2;
        }
    }

    @Override // defpackage.AbstractC4357
    /* renamed from: ˌᵜᵹᵩ */
    public final void mo7250(int i, AbstractC2646 abstractC2646) throws zzacy {
        mo7268((i << 3) | 2);
        mo7265(abstractC2646);
    }

    @Override // defpackage.AbstractC4357
    /* renamed from: ˎˏʜʾ */
    public final void mo7251(int i, int i2) throws zzacy {
        mo7268((i << 3) | 5);
        mo7256(i2);
    }

    @Override // defpackage.AbstractC4357
    /* renamed from: ˏˋٴ */
    public final void mo7252(int i, int i2) throws zzacy {
        mo7268(i << 3);
        mo7268(i2);
    }

    @Override // defpackage.AbstractC4357
    /* renamed from: ˏᵙ */
    public final void mo7253(byte[] bArr, int i, int i2) throws zzacy {
        m7717(bArr, i, i2);
    }

    @Override // defpackage.AbstractC4357
    /* renamed from: ˑᵱ */
    public final void mo7254(long j) throws zzacy {
        int i = this.f12424;
        try {
            byte[] bArr = this.f12425;
            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.f12424 = i + 8;
        } catch (IndexOutOfBoundsException e) {
            throw new zzacy(i, this.f12426, 8, e);
        }
    }

    @Override // defpackage.AbstractC4357
    /* renamed from: ᵝᵵᵺ */
    public final void mo7255(long j, int i) throws zzacy {
        mo7268((i << 3) | 1);
        mo7254(j);
    }

    @Override // defpackage.AbstractC4357
    /* renamed from: ᵞʡ */
    public final void mo7256(int i) throws zzacy {
        int i2 = this.f12424;
        try {
            byte[] bArr = this.f12425;
            bArr[i2] = (byte) i;
            bArr[i2 + 1] = (byte) (i >> 8);
            bArr[i2 + 2] = (byte) (i >> 16);
            bArr[i2 + 3] = (byte) (i >> 24);
            this.f12424 = i2 + 4;
        } catch (IndexOutOfBoundsException e) {
            throw new zzacy(i2, this.f12426, 4, e);
        }
    }

    @Override // defpackage.AbstractC4357
    /* renamed from: ᵡʠ */
    public final void mo7257(int i) throws zzacy {
        if (i >= 0) {
            mo7268(i);
        } else {
            mo7263(i);
        }
    }

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public final void m7717(byte[] bArr, int i, int i2) throws zzacy {
        try {
            System.arraycopy(bArr, i, this.f12425, this.f12424, i2);
            this.f12424 += i2;
        } catch (IndexOutOfBoundsException e) {
            throw new zzacy(this.f12424, this.f12426, i2, e);
        }
    }

    @Override // defpackage.AbstractC4357
    /* renamed from: ᵧᵾˀˈ */
    public final void mo7262(String str) throws zzacy {
        int i = this.f12424;
        try {
            int iM9332 = AbstractC4357.m9332(str.length() * 3);
            int iM93322 = AbstractC4357.m9332(str.length());
            byte[] bArr = this.f12425;
            if (iM93322 != iM9332) {
                mo7268(AbstractC1440.m4344(str));
                int i2 = this.f12424;
                this.f12424 = AbstractC1440.m4342(str, bArr, i2, bArr.length - i2);
            } else {
                int i3 = i + iM93322;
                this.f12424 = i3;
                int iM4342 = AbstractC1440.m4342(str, bArr, i3, bArr.length - i3);
                this.f12424 = i;
                mo7268((iM4342 - i) - iM93322);
                this.f12424 = iM4342;
            }
        } catch (IndexOutOfBoundsException e) {
            throw new zzacy(e);
        }
    }

    @Override // defpackage.AbstractC4357
    /* renamed from: ᵨᵳʝ */
    public final void mo7263(long j) throws zzacy {
        int i;
        int i2 = this.f12424;
        byte[] bArr = this.f12425;
        int i3 = this.f12426;
        if (!AbstractC4357.f16302 || 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) {
                AbstractC0109.m1210(bArr, i2, (byte) (((int) j) | 128));
                j >>>= 7;
                i2++;
            }
            i = i2 + 1;
            AbstractC0109.m1210(bArr, i2, (byte) j);
        }
        this.f12424 = i;
    }

    @Override // defpackage.AbstractC4357
    /* renamed from: ᵪʩ */
    public final void mo7264(int i, byte[] bArr) throws zzacy {
        mo7268(i);
        m7717(bArr, 0, i);
    }

    @Override // defpackage.AbstractC4357
    /* renamed from: ᵯٴᵦ */
    public final void mo7265(AbstractC2646 abstractC2646) throws zzacy {
        mo7268(abstractC2646.mo3575());
        abstractC2646.mo3574(this);
    }

    @Override // defpackage.AbstractC4357
    /* renamed from: ᵳٴᵶ */
    public final void mo7266(AbstractC1126 abstractC1126) throws zzacy {
        AbstractC4985 abstractC4985 = (AbstractC4985) abstractC1126;
        mo7268(abstractC4985.m10436());
        abstractC4985.m10434(this);
    }

    @Override // defpackage.AbstractC4357
    /* renamed from: ᵶᵷᵕ */
    public final void mo7267(int i, boolean z) throws zzacy {
        mo7268(i << 3);
        mo7249(z ? (byte) 1 : (byte) 0);
    }

    @Override // defpackage.AbstractC4357
    /* renamed from: ᵸʓᵠ */
    public final void mo7268(int i) throws zzacy {
        int i2;
        int i3 = this.f12424;
        while (true) {
            int i4 = i & (-128);
            byte[] bArr = this.f12425;
            if (i4 == 0) {
                i2 = i3 + 1;
                bArr[i3] = (byte) i;
                this.f12424 = i2;
                return;
            } else {
                i2 = i3 + 1;
                try {
                    bArr[i3] = (byte) (i | 128);
                    i >>>= 7;
                    i3 = i2;
                } catch (IndexOutOfBoundsException e) {
                    throw new zzacy(i2, this.f12426, 1, e);
                }
            }
            throw new zzacy(i2, this.f12426, 1, e);
        }
    }

    @Override // defpackage.AbstractC4357
    /* renamed from: ᵸˑ */
    public final void mo7269(int i, String str) throws zzacy {
        mo7268((i << 3) | 2);
        mo7262(str);
    }

    @Override // defpackage.AbstractC4357
    /* renamed from: ᵹᵝᵶ */
    public final void mo7270(long j, int i) throws zzacy {
        mo7268(i << 3);
        mo7263(j);
    }

    @Override // defpackage.AbstractC4357
    /* renamed from: ᵻᵢﹳᵰ */
    public final void mo7271(int i, int i2) throws zzacy {
        mo7268((i << 3) | i2);
    }

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public final int m7718() {
        return this.f12426 - this.f12424;
    }
}
