201 * method are read and passed to the corresponding static factory for the type |
202 * method are read and passed to the corresponding static factory for the type |
202 * to create a new instance. That instance is returned as the de-serialized |
203 * to create a new instance. That instance is returned as the de-serialized |
203 * {@code Ser} object. |
204 * {@code Ser} object. |
204 * |
205 * |
205 * <ul> |
206 * <ul> |
206 * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.HijrahChronology">HijrahChronology</a> - Chronology.of(id) |
207 * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.HijrahChronology">HijrahChronology</a> - |
207 * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.IsoChronology">IsoChronology</a> - Chronology.of(id) |
208 * Chronology.of(id) |
208 * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.JapaneseChronology">JapaneseChronology</a> - Chronology.of(id) |
209 * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.IsoChronology">IsoChronology</a> - |
209 * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.MinguoChronology">MinguoChronology</a> - Chronology.of(id) |
210 * Chronology.of(id) |
210 * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.ThaiBuddhistChronology">ThaiBuddhistChronology</a> - Chronology.of(id) |
211 * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.JapaneseChronology">JapaneseChronology</a> - |
211 * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.ChronoLocalDateTimeImpl">ChronoLocalDateTime</a> - date.atTime(time) |
212 * Chronology.of(id) |
212 * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.ChronoZonedDateTimeImpl">ChronoZonedDateTime</a> - dateTime.atZone(offset).withZoneSameLocal(zone) |
213 * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.MinguoChronology">MinguoChronology</a> - |
213 * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.JapaneseDate">JapaneseDate</a> - JapaneseChronology.INSTANCE.date(year, month, dayOfMonth) |
214 * Chronology.of(id) |
214 * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.JapaneseEra">JapaneseEra</a> - JapaneseEra.of(eraValue) |
215 * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.ThaiBuddhistChronology">ThaiBuddhistChronology</a> - |
215 * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.HijrahDate">HijrahDate</a> - HijrahChronology chrono.date(year, month, dayOfMonth) |
216 * Chronology.of(id) |
216 * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.MinguoDate">MinguoDate</a> - MinguoChronology.INSTANCE.date(year, month, dayOfMonth) |
217 * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.ChronoLocalDateTimeImpl">ChronoLocalDateTime</a> - |
217 * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.ThaiBuddhistDate">ThaiBuddhistDate</a> - ThaiBuddhistChronology.INSTANCE.date(year, month, dayOfMonth) |
218 * date.atTime(time) |
|
219 * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.ChronoZonedDateTimeImpl">ChronoZonedDateTime</a> - |
|
220 * dateTime.atZone(offset).withZoneSameLocal(zone) |
|
221 * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.JapaneseDate">JapaneseDate</a> - |
|
222 * JapaneseChronology.INSTANCE.date(year, month, dayOfMonth) |
|
223 * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.JapaneseEra">JapaneseEra</a> - |
|
224 * JapaneseEra.of(eraValue) |
|
225 * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.HijrahDate">HijrahDate</a> - |
|
226 * HijrahChronology chrono.date(year, month, dayOfMonth) |
|
227 * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.MinguoDate">MinguoDate</a> - |
|
228 * MinguoChronology.INSTANCE.date(year, month, dayOfMonth) |
|
229 * <li><a href="{@docRoot}/serialized-form.html#java.time.chrono.ThaiBuddhistDate">ThaiBuddhistDate</a> - |
|
230 * ThaiBuddhistChronology.INSTANCE.date(year, month, dayOfMonth) |
218 * </ul> |
231 * </ul> |
219 * |
232 * |
220 * @param in the data stream to read from, not null |
233 * @param in the data stream to read from, not null |
221 */ |
234 */ |
222 @Override |
235 @Override |
223 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { |
236 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { |
224 type = in.readByte(); |
237 type = in.readByte(); |
225 object = readInternal(type, in); |
238 object = readInternal(type, in); |
226 } |
239 } |
227 |
240 |
228 static Object read(ObjectInput in) throws IOException, ClassNotFoundException { |
241 static Serializable read(ObjectInput in) throws IOException, ClassNotFoundException { |
229 byte type = in.readByte(); |
242 byte type = in.readByte(); |
230 return readInternal(type, in); |
243 return readInternal(type, in); |
231 } |
244 } |
232 |
245 |
233 private static Object readInternal(byte type, ObjectInput in) throws IOException, ClassNotFoundException { |
246 private static Serializable readInternal(byte type, ObjectInput in) |
|
247 throws IOException, ClassNotFoundException { |
234 switch (type) { |
248 switch (type) { |
235 case CHRONO_TYPE: return AbstractChronology.readExternal(in); |
249 case CHRONO_TYPE: return (Serializable)AbstractChronology.readExternal(in); |
236 case CHRONO_LOCAL_DATE_TIME_TYPE: return ChronoLocalDateTimeImpl.readExternal(in); |
250 case CHRONO_LOCAL_DATE_TIME_TYPE: return (Serializable)ChronoLocalDateTimeImpl.readExternal(in); |
237 case CHRONO_ZONE_DATE_TIME_TYPE: return ChronoZonedDateTimeImpl.readExternal(in); |
251 case CHRONO_ZONE_DATE_TIME_TYPE: return (Serializable)ChronoZonedDateTimeImpl.readExternal(in); |
238 case JAPANESE_DATE_TYPE: return JapaneseDate.readExternal(in); |
252 case JAPANESE_DATE_TYPE: return JapaneseDate.readExternal(in); |
239 case JAPANESE_ERA_TYPE: return JapaneseEra.readExternal(in); |
253 case JAPANESE_ERA_TYPE: return JapaneseEra.readExternal(in); |
240 case HIJRAH_DATE_TYPE: return HijrahDate.readExternal(in); |
254 case HIJRAH_DATE_TYPE: return HijrahDate.readExternal(in); |
241 case MINGUO_DATE_TYPE: return MinguoDate.readExternal(in); |
255 case MINGUO_DATE_TYPE: return MinguoDate.readExternal(in); |
242 case THAIBUDDHIST_DATE_TYPE: return ThaiBuddhistDate.readExternal(in); |
256 case THAIBUDDHIST_DATE_TYPE: return ThaiBuddhistDate.readExternal(in); |