package X6FRs_4.Eps4cJe_18;

import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import android.util.SparseIntArray;
import com.wang.avi.BuildConfig;
import java.lang.reflect.Method;
/* compiled from: VersionedParcelParcel.java */
/* loaded from: classes.dex */
public class QxJ9d_1 extends KQgRr5e_0 {
    public final int KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public final Parcel f352KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public final SparseIntArray f353KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public final String f354KQgRr5e_0;

    /* renamed from: Mqv2r_3  reason: collision with root package name */
    public int f3107Mqv2r_3;
    public int PGPF6hQ_2;
    public final int QxJ9d_1;

    /* renamed from: X6FRs_4  reason: collision with root package name */
    public int f3108X6FRs_4;

    public QxJ9d_1(Parcel parcel) {
        this(parcel, parcel.dataPosition(), parcel.dataSize(), BuildConfig.FLAVOR, new X6FRs_4.Mqv2r_3.KQgRr5e_0(), new X6FRs_4.Mqv2r_3.KQgRr5e_0(), new X6FRs_4.Mqv2r_3.KQgRr5e_0());
    }

    @Override // X6FRs_4.Eps4cJe_18.KQgRr5e_0
    public boolean KQgRr5e_0(int i) {
        while (this.f3107Mqv2r_3 < this.QxJ9d_1) {
            int i2 = this.f3108X6FRs_4;
            if (i2 == i) {
                return true;
            }
            if (String.valueOf(i2).compareTo(String.valueOf(i)) > 0) {
                return false;
            }
            this.f352KQgRr5e_0.setDataPosition(this.f3107Mqv2r_3);
            int readInt = this.f352KQgRr5e_0.readInt();
            this.f3108X6FRs_4 = this.f352KQgRr5e_0.readInt();
            this.f3107Mqv2r_3 += readInt;
        }
        return this.f3108X6FRs_4 == i;
    }

    @Override // X6FRs_4.Eps4cJe_18.KQgRr5e_0
    public void QxJ9d_1(int i) {
        this.f352KQgRr5e_0.writeInt(i);
    }

    public QxJ9d_1(Parcel parcel, int i, int i2, String str, X6FRs_4.Mqv2r_3.KQgRr5e_0<String, Method> kQgRr5e_0, X6FRs_4.Mqv2r_3.KQgRr5e_0<String, Method> kQgRr5e_02, X6FRs_4.Mqv2r_3.KQgRr5e_0<String, Class> kQgRr5e_03) {
        super(kQgRr5e_0, kQgRr5e_02, kQgRr5e_03);
        this.f353KQgRr5e_0 = new SparseIntArray();
        this.PGPF6hQ_2 = -1;
        this.f3107Mqv2r_3 = 0;
        this.f3108X6FRs_4 = -1;
        this.f352KQgRr5e_0 = parcel;
        this.KQgRr5e_0 = i;
        this.QxJ9d_1 = i2;
        this.f3107Mqv2r_3 = i;
        this.f354KQgRr5e_0 = str;
    }

    @Override // X6FRs_4.Eps4cJe_18.KQgRr5e_0
    public boolean QxJ9d_1() {
        return this.f352KQgRr5e_0.readInt() != 0;
    }

    @Override // X6FRs_4.Eps4cJe_18.KQgRr5e_0
    public void KQgRr5e_0(int i) {
        KQgRr5e_0();
        this.PGPF6hQ_2 = i;
        this.f353KQgRr5e_0.put(i, this.f352KQgRr5e_0.dataPosition());
        QxJ9d_1(0);
        QxJ9d_1(i);
    }

    @Override // X6FRs_4.Eps4cJe_18.KQgRr5e_0
    public void KQgRr5e_0() {
        int i = this.PGPF6hQ_2;
        if (i >= 0) {
            int i2 = this.f353KQgRr5e_0.get(i);
            int dataPosition = this.f352KQgRr5e_0.dataPosition();
            this.f352KQgRr5e_0.setDataPosition(i2);
            this.f352KQgRr5e_0.writeInt(dataPosition - i2);
            this.f352KQgRr5e_0.setDataPosition(dataPosition);
        }
    }

    @Override // X6FRs_4.Eps4cJe_18.KQgRr5e_0
    public KQgRr5e_0 KQgRr5e_0() {
        Parcel parcel = this.f352KQgRr5e_0;
        int dataPosition = parcel.dataPosition();
        int i = this.f3107Mqv2r_3;
        if (i == this.KQgRr5e_0) {
            i = this.QxJ9d_1;
        }
        int i2 = i;
        return new QxJ9d_1(parcel, dataPosition, i2, this.f354KQgRr5e_0 + "  ", ((KQgRr5e_0) this).KQgRr5e_0, super.QxJ9d_1, super.PGPF6hQ_2);
    }

    @Override // X6FRs_4.Eps4cJe_18.KQgRr5e_0
    public void KQgRr5e_0(byte[] bArr) {
        if (bArr != null) {
            this.f352KQgRr5e_0.writeInt(bArr.length);
            this.f352KQgRr5e_0.writeByteArray(bArr);
            return;
        }
        this.f352KQgRr5e_0.writeInt(-1);
    }

    @Override // X6FRs_4.Eps4cJe_18.KQgRr5e_0
    public void KQgRr5e_0(String str) {
        this.f352KQgRr5e_0.writeString(str);
    }

    @Override // X6FRs_4.Eps4cJe_18.KQgRr5e_0
    public void KQgRr5e_0(Parcelable parcelable) {
        this.f352KQgRr5e_0.writeParcelable(parcelable, 0);
    }

    @Override // X6FRs_4.Eps4cJe_18.KQgRr5e_0
    public void KQgRr5e_0(boolean z) {
        this.f352KQgRr5e_0.writeInt(z ? 1 : 0);
    }

    @Override // X6FRs_4.Eps4cJe_18.KQgRr5e_0
    public void KQgRr5e_0(CharSequence charSequence) {
        TextUtils.writeToParcel(charSequence, this.f352KQgRr5e_0, 0);
    }

    @Override // X6FRs_4.Eps4cJe_18.KQgRr5e_0
    public CharSequence KQgRr5e_0() {
        return (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(this.f352KQgRr5e_0);
    }

    @Override // X6FRs_4.Eps4cJe_18.KQgRr5e_0
    public int KQgRr5e_0() {
        return this.f352KQgRr5e_0.readInt();
    }

    @Override // X6FRs_4.Eps4cJe_18.KQgRr5e_0
    public String KQgRr5e_0() {
        return this.f352KQgRr5e_0.readString();
    }

    @Override // X6FRs_4.Eps4cJe_18.KQgRr5e_0
    public byte[] KQgRr5e_0() {
        int readInt = this.f352KQgRr5e_0.readInt();
        if (readInt < 0) {
            return null;
        }
        byte[] bArr = new byte[readInt];
        this.f352KQgRr5e_0.readByteArray(bArr);
        return bArr;
    }

    @Override // X6FRs_4.Eps4cJe_18.KQgRr5e_0
    public <T extends Parcelable> T KQgRr5e_0() {
        return (T) this.f352KQgRr5e_0.readParcelable(QxJ9d_1.class.getClassLoader());
    }
}
