package p074z0;

import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import android.util.SparseIntArray;
import java.lang.reflect.Method;
import p037m.C1444a;

/* renamed from: z0.b */
/* loaded from: classes.dex */
public class C1917b extends AbstractC1916a {

    /* renamed from: d */
    public final SparseIntArray f4714d;

    /* renamed from: e */
    public final Parcel f4715e;

    /* renamed from: f */
    public final int f4716f;

    /* renamed from: g */
    public final int f4717g;

    /* renamed from: h */
    public final String f4718h;

    /* renamed from: i */
    public int f4719i;

    /* renamed from: j */
    public int f4720j;

    /* renamed from: k */
    public int f4721k;

    public C1917b(Parcel parcel) {
        this(parcel, parcel.dataPosition(), parcel.dataSize(), "", new C1444a(), new C1444a(), new C1444a());
    }

    public C1917b(Parcel parcel, int i, int i2, String str, C1444a<String, Method> c1444a, C1444a<String, Method> c1444a2, C1444a<String, Class> c1444a3) {
        super(c1444a, c1444a2, c1444a3);
        this.f4714d = new SparseIntArray();
        this.f4719i = -1;
        this.f4721k = -1;
        this.f4715e = parcel;
        this.f4716f = i;
        this.f4717g = i2;
        this.f4720j = i;
        this.f4718h = str;
    }

    @Override // p074z0.AbstractC1916a
    /* renamed from: A */
    public void mo15A(byte[] bArr) {
        if (bArr == null) {
            this.f4715e.writeInt(-1);
            return;
        }
        this.f4715e.writeInt(bArr.length);
        this.f4715e.writeByteArray(bArr);
    }

    @Override // p074z0.AbstractC1916a
    /* renamed from: C */
    public void mo14C(CharSequence charSequence) {
        TextUtils.writeToParcel(charSequence, this.f4715e, 0);
    }

    @Override // p074z0.AbstractC1916a
    /* renamed from: E */
    public void mo13E(int i) {
        this.f4715e.writeInt(i);
    }

    @Override // p074z0.AbstractC1916a
    /* renamed from: G */
    public void mo12G(Parcelable parcelable) {
        this.f4715e.writeParcelable(parcelable, 0);
    }

    @Override // p074z0.AbstractC1916a
    /* renamed from: I */
    public void mo11I(String str) {
        this.f4715e.writeString(str);
    }

    @Override // p074z0.AbstractC1916a
    /* renamed from: a */
    public void mo10a() {
        int i = this.f4719i;
        if (i >= 0) {
            int i2 = this.f4714d.get(i);
            int dataPosition = this.f4715e.dataPosition();
            this.f4715e.setDataPosition(i2);
            this.f4715e.writeInt(dataPosition - i2);
            this.f4715e.setDataPosition(dataPosition);
        }
    }

    @Override // p074z0.AbstractC1916a
    /* renamed from: b */
    public AbstractC1916a mo9b() {
        Parcel parcel = this.f4715e;
        int dataPosition = parcel.dataPosition();
        int i = this.f4720j;
        if (i == this.f4716f) {
            i = this.f4717g;
        }
        int i2 = i;
        return new C1917b(parcel, dataPosition, i2, this.f4718h + "  ", this.f4711a, this.f4712b, this.f4713c);
    }

    @Override // p074z0.AbstractC1916a
    /* renamed from: g */
    public boolean mo8g() {
        return this.f4715e.readInt() != 0;
    }

    @Override // p074z0.AbstractC1916a
    /* renamed from: i */
    public byte[] mo7i() {
        int readInt = this.f4715e.readInt();
        if (readInt < 0) {
            return null;
        }
        byte[] bArr = new byte[readInt];
        this.f4715e.readByteArray(bArr);
        return bArr;
    }

    @Override // p074z0.AbstractC1916a
    /* renamed from: k */
    public CharSequence mo6k() {
        return (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(this.f4715e);
    }

    @Override // p074z0.AbstractC1916a
    /* renamed from: m */
    public boolean mo5m(int i) {
        while (this.f4720j < this.f4717g) {
            int i2 = this.f4721k;
            if (i2 == i) {
                return true;
            }
            if (String.valueOf(i2).compareTo(String.valueOf(i)) > 0) {
                return false;
            }
            this.f4715e.setDataPosition(this.f4720j);
            int readInt = this.f4715e.readInt();
            this.f4721k = this.f4715e.readInt();
            this.f4720j += readInt;
        }
        return this.f4721k == i;
    }

    @Override // p074z0.AbstractC1916a
    /* renamed from: o */
    public int mo4o() {
        return this.f4715e.readInt();
    }

    @Override // p074z0.AbstractC1916a
    /* renamed from: q */
    public <T extends Parcelable> T mo3q() {
        return (T) this.f4715e.readParcelable(getClass().getClassLoader());
    }

    @Override // p074z0.AbstractC1916a
    /* renamed from: s */
    public String mo2s() {
        return this.f4715e.readString();
    }

    @Override // p074z0.AbstractC1916a
    /* renamed from: w */
    public void mo1w(int i) {
        mo10a();
        this.f4719i = i;
        this.f4714d.put(i, this.f4715e.dataPosition());
        mo13E(0);
        mo13E(i);
    }

    @Override // p074z0.AbstractC1916a
    /* renamed from: y */
    public void mo0y(boolean z) {
        this.f4715e.writeInt(z ? 1 : 0);
    }
}