package com.google.android.gms.internal.play_billing;

import Z0.o;
import java.io.Serializable;
import java.util.Iterator;
import java.util.Locale;

/* JADX INFO: loaded from: classes3.dex */
public abstract class zzei implements Iterable, Serializable {
    public static final zzei zzb = new zzeg(zzfo.zzb);
    private int zza = 0;

    static {
        int i6 = zzdv.zza;
    }

    public static int zzh(int i6, int i7, int i8) {
        int i9 = i7 - i6;
        if ((i6 | i7 | i9 | (i8 - i7)) >= 0) {
            return i9;
        }
        if (i6 < 0) {
            throw new IndexOutOfBoundsException(o.j(i6, "Beginning index: ", " < 0"));
        }
        if (i7 < i6) {
            throw new IndexOutOfBoundsException(com.google.android.recaptcha.internal.a.i(i6, i7, "Beginning index larger than ending index: ", ", "));
        }
        throw new IndexOutOfBoundsException(com.google.android.recaptcha.internal.a.i(i7, i8, "End index: ", " >= "));
    }

    public static zzei zzj(byte[] bArr, int i6, int i7) {
        zzh(i6, i6 + i7, bArr.length);
        byte[] bArr2 = new byte[i7];
        System.arraycopy(bArr, i6, bArr2, 0, i7);
        return new zzeg(bArr2);
    }

    public abstract boolean equals(Object obj);

    public final int hashCode() {
        int iZze = this.zza;
        if (iZze == 0) {
            int iZzd = zzd();
            iZze = zze(iZzd, 0, iZzd);
            if (iZze == 0) {
                iZze = 1;
            }
            this.zza = iZze;
        }
        return iZze;
    }

    @Override // java.lang.Iterable
    public final /* synthetic */ Iterator iterator() {
        return new zzea(this);
    }

    public final String toString() {
        Locale locale = Locale.ROOT;
        String hexString = Integer.toHexString(System.identityHashCode(this));
        return com.google.android.recaptcha.internal.a.n(o.s(zzd(), "<ByteString@", hexString, " size=", " contents=\""), zzd() <= 50 ? zzhf.zza(this) : zzhf.zza(zzf(0, 47)).concat("..."), "\">");
    }

    public abstract byte zza(int i6);

    public abstract byte zzb(int i6);

    public abstract int zzd();

    public abstract int zze(int i6, int i7, int i8);

    public abstract zzei zzf(int i6, int i7);

    public abstract void zzg(zzdz zzdzVar);

    public final int zzi() {
        return this.zza;
    }
}
