mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2024-12-27 09:32:27 -06:00
228 lines
7.4 KiB
Java
228 lines
7.4 KiB
Java
package androidx.versionedparcelable;
|
|
|
|
import android.os.Bundle;
|
|
import android.os.IBinder;
|
|
import android.os.IInterface;
|
|
import android.os.Parcel;
|
|
import android.os.Parcelable;
|
|
import android.text.TextUtils;
|
|
import android.util.SparseIntArray;
|
|
import androidx.collection.ArrayMap;
|
|
import java.lang.reflect.Method;
|
|
|
|
/* loaded from: classes2.dex */
|
|
class VersionedParcelParcel extends VersionedParcel {
|
|
private static final boolean DEBUG = false;
|
|
private static final String TAG = "VersionedParcelParcel";
|
|
private int mCurrentField;
|
|
private final int mEnd;
|
|
private int mFieldId;
|
|
private int mNextRead;
|
|
private final int mOffset;
|
|
private final Parcel mParcel;
|
|
private final SparseIntArray mPositionLookup;
|
|
private final String mPrefix;
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public VersionedParcelParcel(Parcel parcel) {
|
|
this(parcel, parcel.dataPosition(), parcel.dataSize(), "", new ArrayMap(), new ArrayMap(), new ArrayMap());
|
|
}
|
|
|
|
private VersionedParcelParcel(Parcel parcel, int i, int i2, String str, ArrayMap<String, Method> arrayMap, ArrayMap<String, Method> arrayMap2, ArrayMap<String, Class> arrayMap3) {
|
|
super(arrayMap, arrayMap2, arrayMap3);
|
|
this.mPositionLookup = new SparseIntArray();
|
|
this.mCurrentField = -1;
|
|
this.mFieldId = -1;
|
|
this.mParcel = parcel;
|
|
this.mOffset = i;
|
|
this.mEnd = i2;
|
|
this.mNextRead = i;
|
|
this.mPrefix = str;
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
public boolean readField(int i) {
|
|
while (this.mNextRead < this.mEnd) {
|
|
int i2 = this.mFieldId;
|
|
if (i2 == i) {
|
|
return true;
|
|
}
|
|
if (String.valueOf(i2).compareTo(String.valueOf(i)) > 0) {
|
|
return false;
|
|
}
|
|
this.mParcel.setDataPosition(this.mNextRead);
|
|
int readInt = this.mParcel.readInt();
|
|
this.mFieldId = this.mParcel.readInt();
|
|
this.mNextRead += readInt;
|
|
}
|
|
return this.mFieldId == i;
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
public void setOutputField(int i) {
|
|
closeField();
|
|
this.mCurrentField = i;
|
|
this.mPositionLookup.put(i, this.mParcel.dataPosition());
|
|
writeInt(0);
|
|
writeInt(i);
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
public void closeField() {
|
|
int i = this.mCurrentField;
|
|
if (i >= 0) {
|
|
int i2 = this.mPositionLookup.get(i);
|
|
int dataPosition = this.mParcel.dataPosition();
|
|
this.mParcel.setDataPosition(i2);
|
|
this.mParcel.writeInt(dataPosition - i2);
|
|
this.mParcel.setDataPosition(dataPosition);
|
|
}
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
protected VersionedParcel createSubParcel() {
|
|
Parcel parcel = this.mParcel;
|
|
int dataPosition = parcel.dataPosition();
|
|
int i = this.mNextRead;
|
|
if (i == this.mOffset) {
|
|
i = this.mEnd;
|
|
}
|
|
return new VersionedParcelParcel(parcel, dataPosition, i, this.mPrefix + " ", this.mReadCache, this.mWriteCache, this.mParcelizerCache);
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
public void writeByteArray(byte[] bArr) {
|
|
if (bArr != null) {
|
|
this.mParcel.writeInt(bArr.length);
|
|
this.mParcel.writeByteArray(bArr);
|
|
} else {
|
|
this.mParcel.writeInt(-1);
|
|
}
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
public void writeByteArray(byte[] bArr, int i, int i2) {
|
|
if (bArr != null) {
|
|
this.mParcel.writeInt(bArr.length);
|
|
this.mParcel.writeByteArray(bArr, i, i2);
|
|
} else {
|
|
this.mParcel.writeInt(-1);
|
|
}
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
public void writeInt(int i) {
|
|
this.mParcel.writeInt(i);
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
public void writeLong(long j) {
|
|
this.mParcel.writeLong(j);
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
public void writeFloat(float f) {
|
|
this.mParcel.writeFloat(f);
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
public void writeDouble(double d) {
|
|
this.mParcel.writeDouble(d);
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
public void writeString(String str) {
|
|
this.mParcel.writeString(str);
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
public void writeStrongBinder(IBinder iBinder) {
|
|
this.mParcel.writeStrongBinder(iBinder);
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
public void writeParcelable(Parcelable parcelable) {
|
|
this.mParcel.writeParcelable(parcelable, 0);
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
public void writeBoolean(boolean z) {
|
|
this.mParcel.writeInt(z ? 1 : 0);
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
public void writeStrongInterface(IInterface iInterface) {
|
|
this.mParcel.writeStrongInterface(iInterface);
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
public void writeBundle(Bundle bundle) {
|
|
this.mParcel.writeBundle(bundle);
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
protected void writeCharSequence(CharSequence charSequence) {
|
|
TextUtils.writeToParcel(charSequence, this.mParcel, 0);
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
protected CharSequence readCharSequence() {
|
|
return (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(this.mParcel);
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
public int readInt() {
|
|
return this.mParcel.readInt();
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
public long readLong() {
|
|
return this.mParcel.readLong();
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
public float readFloat() {
|
|
return this.mParcel.readFloat();
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
public double readDouble() {
|
|
return this.mParcel.readDouble();
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
public String readString() {
|
|
return this.mParcel.readString();
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
public IBinder readStrongBinder() {
|
|
return this.mParcel.readStrongBinder();
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
public byte[] readByteArray() {
|
|
int readInt = this.mParcel.readInt();
|
|
if (readInt < 0) {
|
|
return null;
|
|
}
|
|
byte[] bArr = new byte[readInt];
|
|
this.mParcel.readByteArray(bArr);
|
|
return bArr;
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
public <T extends Parcelable> T readParcelable() {
|
|
return (T) this.mParcel.readParcelable(getClass().getClassLoader());
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
public Bundle readBundle() {
|
|
return this.mParcel.readBundle(getClass().getClassLoader());
|
|
}
|
|
|
|
@Override // androidx.versionedparcelable.VersionedParcel
|
|
public boolean readBoolean() {
|
|
return this.mParcel.readInt() != 0;
|
|
}
|
|
}
|