package b.n;

import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import android.util.SparseIntArray;
import com.cvte.vman.BuildConfig;
import java.lang.reflect.Method;

/* JADX INFO: loaded from: classes.dex */
public class b extends a {

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final SparseIntArray f1316d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final Parcel f1317e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final int f1318f;
    public final int g;
    public final String h;
    public int i;
    public int j;
    public int k;

    public b(Parcel parcel) {
        this(parcel, parcel.dataPosition(), parcel.dataSize(), BuildConfig.FLAVOR, new b.d.a(), new b.d.a(), new b.d.a());
    }

    public b(Parcel parcel, int i, int i2, String str, b.d.a<String, Method> aVar, b.d.a<String, Method> aVar2, b.d.a<String, Class> aVar3) {
        super(aVar, aVar2, aVar3);
        this.f1316d = new SparseIntArray();
        this.i = -1;
        this.j = 0;
        this.k = -1;
        this.f1317e = parcel;
        this.f1318f = i;
        this.g = i2;
        this.j = i;
        this.h = str;
    }

    @Override // b.n.a
    public void a() {
        int i = this.i;
        if (i >= 0) {
            int i2 = this.f1316d.get(i);
            int iDataPosition = this.f1317e.dataPosition();
            this.f1317e.setDataPosition(i2);
            this.f1317e.writeInt(iDataPosition - i2);
            this.f1317e.setDataPosition(iDataPosition);
        }
    }

    @Override // b.n.a
    public a b() {
        Parcel parcel = this.f1317e;
        int iDataPosition = parcel.dataPosition();
        int i = this.j;
        if (i == this.f1318f) {
            i = this.g;
        }
        return new b(parcel, iDataPosition, i, this.h + "  ", this.f1313a, this.f1314b, this.f1315c);
    }

    @Override // b.n.a
    public boolean f() {
        return this.f1317e.readInt() != 0;
    }

    @Override // b.n.a
    public byte[] g() {
        int i = this.f1317e.readInt();
        if (i < 0) {
            return null;
        }
        byte[] bArr = new byte[i];
        this.f1317e.readByteArray(bArr);
        return bArr;
    }

    @Override // b.n.a
    public CharSequence h() {
        return (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(this.f1317e);
    }

    @Override // b.n.a
    public boolean i(int i) {
        while (this.j < this.g) {
            int i2 = this.k;
            if (i2 == i) {
                return true;
            }
            if (String.valueOf(i2).compareTo(String.valueOf(i)) > 0) {
                return false;
            }
            this.f1317e.setDataPosition(this.j);
            int i3 = this.f1317e.readInt();
            this.k = this.f1317e.readInt();
            this.j += i3;
        }
        return this.k == i;
    }

    @Override // b.n.a
    public int j() {
        return this.f1317e.readInt();
    }

    @Override // b.n.a
    public <T extends Parcelable> T l() {
        return (T) this.f1317e.readParcelable(b.class.getClassLoader());
    }

    @Override // b.n.a
    public String n() {
        return this.f1317e.readString();
    }

    @Override // b.n.a
    public void p(int i) {
        a();
        this.i = i;
        this.f1316d.put(i, this.f1317e.dataPosition());
        this.f1317e.writeInt(0);
        this.f1317e.writeInt(i);
    }

    @Override // b.n.a
    public void q(boolean z) {
        this.f1317e.writeInt(z ? 1 : 0);
    }

    @Override // b.n.a
    public void r(byte[] bArr) {
        if (bArr == null) {
            this.f1317e.writeInt(-1);
        } else {
            this.f1317e.writeInt(bArr.length);
            this.f1317e.writeByteArray(bArr);
        }
    }

    @Override // b.n.a
    public void s(CharSequence charSequence) {
        TextUtils.writeToParcel(charSequence, this.f1317e, 0);
    }

    @Override // b.n.a
    public void t(int i) {
        this.f1317e.writeInt(i);
    }

    @Override // b.n.a
    public void u(Parcelable parcelable) {
        this.f1317e.writeParcelable(parcelable, 0);
    }

    @Override // b.n.a
    public void v(String str) {
        this.f1317e.writeString(str);
    }
}
