package j$.time;

import java.io.Externalizable;
import java.io.IOException;
import java.io.InvalidClassException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.Serializable;
import java.io.StreamCorruptedException;

/* JADX INFO: loaded from: classes2.dex */
final class t implements Externalizable {
    private static final long serialVersionUID = -7683839454370182990L;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private byte f19325a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private Object f19326b;

    public t() {
    }

    t(byte b5, Object obj) {
        this.f19325a = b5;
        this.f19326b = obj;
    }

    @Override // java.io.Externalizable
    public final void writeExternal(ObjectOutput objectOutput) throws IOException {
        byte b5 = this.f19325a;
        Object obj = this.f19326b;
        objectOutput.writeByte(b5);
        switch (b5) {
            case 1:
                ((f) obj).writeExternal(objectOutput);
                return;
            case 2:
                ((Instant) obj).b0(objectOutput);
                return;
            case 3:
                ((LocalDate) obj).v0(objectOutput);
                return;
            case 4:
                ((l) obj).q0(objectOutput);
                return;
            case 5:
                ((LocalDateTime) obj).l0(objectOutput);
                return;
            case 6:
                ((ZonedDateTime) obj).d0(objectOutput);
                return;
            case 7:
                ((y) obj).c0(objectOutput);
                return;
            case 8:
                ((ZoneOffset) obj).i0(objectOutput);
                return;
            case 9:
                ((r) obj).writeExternal(objectOutput);
                return;
            case 10:
                ((OffsetDateTime) obj).writeExternal(objectOutput);
                return;
            case 11:
                ((v) obj).V(objectOutput);
                return;
            case 12:
                ((x) obj).c0(objectOutput);
                return;
            case 13:
                ((p) obj).B(objectOutput);
                return;
            case 14:
                ((s) obj).writeExternal(objectOutput);
                return;
            default:
                throw new InvalidClassException("Unknown serialized type");
        }
    }

    @Override // java.io.Externalizable
    public final void readExternal(ObjectInput objectInput) throws IOException {
        byte b5 = objectInput.readByte();
        this.f19325a = b5;
        this.f19326b = b(b5, objectInput);
    }

    static Serializable a(ObjectInput objectInput) {
        return b(objectInput.readByte(), objectInput);
    }

    private static Serializable b(byte b5, ObjectInput objectInput) throws StreamCorruptedException {
        switch (b5) {
            case 1:
                f fVar = f.f19189c;
                return f.U(objectInput.readLong(), objectInput.readInt());
            case 2:
                Instant instant = Instant.EPOCH;
                return Instant.ofEpochSecond(objectInput.readLong(), objectInput.readInt());
            case 3:
                LocalDate localDate = LocalDate.f19105d;
                return LocalDate.h0(objectInput.readInt(), objectInput.readByte(), objectInput.readByte());
            case 4:
                return l.l0(objectInput);
            case 5:
                LocalDateTime localDateTime = LocalDateTime.f19110c;
                LocalDate localDate2 = LocalDate.f19105d;
                return LocalDateTime.c0(LocalDate.h0(objectInput.readInt(), objectInput.readByte(), objectInput.readByte()), l.l0(objectInput));
            case 6:
                return ZonedDateTime.V(objectInput);
            case 7:
                int i6 = y.f19385d;
                return ZoneId.J(objectInput.readUTF(), false);
            case 8:
                return ZoneOffset.h0(objectInput);
            case 9:
                return r.J(objectInput);
            case 10:
                return OffsetDateTime.U(objectInput);
            case 11:
                int i7 = v.f19379b;
                return v.r(objectInput.readInt());
            case 12:
                return x.V(objectInput);
            case 13:
                return p.r(objectInput);
            case 14:
                return s.c(objectInput);
            default:
                throw new StreamCorruptedException("Unknown serialized type");
        }
    }

    private Object readResolve() {
        return this.f19326b;
    }
}
