private Object readResolve() throws InvalidObjectException
InvalidObjectException - if the state is inconsistentint month
int dayOfMonth
long days
PlainTime time
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
6 and as
least significant bit the value 1 if long should be used
for transferring the item amounts (else using int). Then
the data bytes for the duration items follow. The byte
sequence optionally ends with the sign information.
Schematic algorithm:
boolean useLong = ...;
byte header = (6 << 4);
if (useLong) header |= 1;
out.writeByte(header);
out.writeInt(getTotalLength().size());
for (Item<U> item : getTotalLength()) {
if (useLong) {
out.writeLong(item.getAmount());
} else {
out.writeInt((int) item.getAmount());
}
out.writeObject(item.getUnit());
}
if (getTotalLength().size() > 0) {
out.writeBoolean(isNegative());
}
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
5 and as
least significant bit the value 1 if this instance uses
the UTC-scale. Then the bytes for the seconds and fraction
follow. The fraction bytes are only written if the fraction
is not zero. In that case, the second least significant bit
of the header is set, too.
Schematic algorithm:
byte header = (5 << 4);
if (scale == TimeScale.UTC) header |= 1;
if (this.getFraction() > 0) header |= 2;
out.writeByte(header);
out.writeLong(getSeconds());
if (this.getFraction() > 0) {
out.writeInt(getFraction());
}
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
4. The lowest bit is 1 if this
instance is a positive leap second. The bit (2) will be
set if there is a non-zero nanosecond part. After this
header byte eight bytes follow containing the unix time
(as long) and optional four bytes with the fraction part.
Schematic algorithm:
int header = 4;
header <<= 4;
if (isLeapSecond()) {
header |= 1;
}
int fraction = getNanosecond();
if (fraction > 0) {
header |= 2;
}
out.writeByte(header);
out.writeLong(getPosixTime());
if (fraction > 0) {
out.writeInt(fraction);
}
Timezone tz
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
1. The following
bits 4-7 contain the month. The second byte contains
at the bits 1-2 a year mark: 1 = year in the range
1850-2100, 2 = four-digit-year, 3 = year number with more
than four digits. The five least significant bits of second
byte contain the day of month. Then the year will be written
dependent on the year mark. Is the mark 1 then the year
will be written as byte, if the mark is 2 then the year
will be written as short else as int with four bytes.
Schematic algorithm:
int range;
if (year >= 1850 && year <= 2100) {
range = 1;
} else if (Math.abs(year) < 10000) {
range = 2;
} else {
range = 3;
}
int header = 1;
header <<= 4;
header |= month;
out.writeByte(header);
int header2 = range;
header2 <<= 5;
header2 |= dayOfMonth;
out.writeByte(header2);
if (range == 1) {
out.writeByte(year - 1850 - 128);
} else if (range == 2) {
out.writeShort(year);
} else {
out.writeInt(year);
}
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
2. Then
the data bytes for hour, minute, second and nanosecond
follow (in last case int instead of byte). Is the precision
limited to seconds, minutes or hours then the last non-zero
byte will be bit-inverted by the operator (~), and the
following bytes will be left out. The hour byte however
is always written.
Schematic algorithm:
out.writeByte(2 << 4);
if (time.nano == 0) {
if (time.second == 0) {
if (time.minute == 0) {
out.writeByte(~time.hour);
} else {
out.writeByte(time.hour);
out.writeByte(~time.minute);
}
} else {
out.writeByte(time.hour);
out.writeByte(time.minute);
out.writeByte(~time.second);
}
} else {
out.writeByte(time.hour);
out.writeByte(time.minute);
out.writeByte(time.second);
out.writeInt(time.nano);
}
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
8. Then
the data bytes for date and time component follow.
Schematic algorithm:
int range;
if (year >= 1850 && year <= 2100) {
range = 1;
} else if (Math.abs(year) < 10000) {
range = 2;
} else {
range = 3;
}
int header = 8; // type-id
header <<= 4;
header |= month;
out.writeByte(header);
int header2 = range;
header2 <<= 5;
header2 |= dayOfMonth;
out.writeByte(header2);
if (range == 1) {
out.writeByte(year - 1850 - 128);
} else if (range == 2) {
out.writeShort(year);
} else {
out.writeInt(year);
}
if (time.nano == 0) {
if (time.second == 0) {
if (time.minute == 0) {
out.writeByte(~time.hour);
} else {
out.writeByte(time.hour);
out.writeByte(~time.minute);
}
} else {
out.writeByte(time.hour);
out.writeByte(time.minute);
out.writeByte(~time.second);
}
} else {
out.writeByte(time.hour);
out.writeByte(time.minute);
out.writeByte(time.second);
out.writeInt(time.nano);
}
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
Implementation method of interface Externalizable.
IOException - in any case of IO-failuresClassNotFoundException - if class-loading failspublic void writeExternal(ObjectOutput out) throws IOException
Implementation method of interface Externalizable.
The first byte contains within the 4 most-significant bits the type of the object to be serialized. Then the data bytes follow in a bit-compressed representation.
writeReplace()-method of object
to be serializedIOException - in any case of IO-failuresprivate Object readResolve() throws ObjectStreamException
ObjectStreamExceptionprivate void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
3. If the weekend
is not saturday and sunday then the four least significant
bits will be set to 1. The second byte has in the
four most significant bits the first day of week, in the
other four bits the minimum days of first calendar week.
If there is no standard weekend then a third byte follows
which contains in the four most significant bits the start
and the four least significant bits the end of weekend.
Schematic algorithm:
boolean isoWeekend = (
(getStartOfWeekend() == Weekday.SATURDAY)
&& (getEndOfWeekend() == Weekday.SUNDAY)
);
int header = 3;
header <<= 4;
if (!isoWeekend) {
header |= 1;
}
out.writeByte(header);
int state = getFirstDayOfWeek().getValue();
state <<= 4;
state |= getMinimalDaysInFirstWeek();
out.writeByte(state);
if (!isoWeekend) {
state = getStartOfWeekend().getValue();
state <<= 4;
state |= getEndOfWeekend().getValue();
out.writeByte(state);
}
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
14. Then the cycle, year-of-cycle and the month number
are written as byte, finally the leap state of month as boolean and
the day-of-month as byte.private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
3. Then the year is written as int, finally
month and day-of-month as bytes.Object readResolve() throws ObjectStreamException
IllegalArgumentException - if the year is not in range 1-60ObjectStreamExceptionprivate Object readResolve() throws ObjectStreamException
ObjectStreamException - if deserializing is not possibleint index
boolean leap
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
4. Then the era ordinal is written as byte, the year-of-era
is written as int, finally month and day-of-month written as bytes.private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
5. Then the time of day in seconds using western
format is written as integer.private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
12. Then the year is written as int, finally
month.getValue() and day-of-month as bytes.private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
13. Then a boolean flag is written (set to true if day).
Finally the hour is written as byte and the part of hour written as short integer.private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
1. Then the UTF-coded variant and its data version
follow. Finally the year is written as int, month and day-of-month as bytes.
The successful serialization requires equal versions per variant on both sides.private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
11. Then the calendar history is written out as UTF-string.
Finally the UTC-epoch-days of corresponding gregorian date will be serialized as long.PlainDate gregorian
ChronoHistory history
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
10. Then the year is written as int, finally
month and day-of-month as bytes.private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
9. Then the related gregorian year and the day-of-year
are written as int-primitives. Note that the serialization round-trip
might fail for calendar objects created in lax mode due to normalization.private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
17. Then the associated gregorian date is written.PlainDate iso
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
7. Then the year is written as int, finally
month and day-of-month as bytes.private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
15. Then the cycle, year-of-cycle and the month number
are written as byte, finally the leap state of month as boolean and
the day-of-month as byte.private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
6. Then the associated gregorian date is written.PlainDate iso
private Object readResolve() throws ObjectStreamException
ObjectStreamException - if deserializing is not possiblebyte court
int index
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
2. Then the year is written as int, finally
month and day-of-month as bytes.Object readResolve() throws ObjectStreamException
IllegalArgumentException - if the cyclic number is not in range 1-60ObjectStreamExceptionint number
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
Implementation method of interface Externalizable.
IOException - in any case of IO-failuresClassNotFoundException - if class loading failspublic void writeExternal(ObjectOutput out) throws IOException
Implementation method of interface Externalizable.
The first byte contains the type of the object to be serialized. Then the data bytes follow in a possibly bit-compressed representation.
writeReplace()-method of object
to be serializedIOException - in any case of IO-failuresprivate void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
8. Then the associated gregorian date is written.PlainDate iso
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
16. Then the cycle, year-of-cycle and the month number
are written as byte, finally the leap state of month as boolean and
the day-of-month as byte.private void readObject(ObjectInputStream in) throws IOException
StreamCorruptedException - if the data are not consistentIOException - if the data cannot be readdouble value
TimeScale scale
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
IOException - in any case of I/O-errorsClassNotFoundException - in any case of I/O-errorsIllegalArgumentException - in any case of inconsistent statedouble latitude
double longitude
int altitude
TZID observerZoneID
double rightAscension
double declination
double azimuth
double elevation
double distance
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
IOException - in any case of I/O-errorsClassNotFoundException - in any case of I/O-errorsIllegalArgumentException - in any case of inconsistent statedouble latitude
double longitude
int altitude
String calculator
TZID observerZoneID
double rightAscension
double declination
double azimuth
double elevation
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
19. Then the kull-i-shai-cycle, the vahid-cycle, the year of vahid
and finally the month and day-of-month as bytes. Ayyam-i-Ha will be modelled as zero.public void readExternal(ObjectInput in) throws IOException
Implementation method of interface Externalizable.
IOException - in any case of IO-failurespublic void writeExternal(ObjectOutput out) throws IOException
Implementation method of interface Externalizable.
The first byte contains the type of the object to be serialized. Then the data bytes follow in a possibly bit-compressed representation.
writeReplace()-method of object
to be serializedIOException - in any case of IO-failuresprivate void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
18. Then the year is written as int, finally
month and day-of-month as bytes.public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
Implementation method of interface Externalizable.
IOException - in any case of IO-failuresClassNotFoundException - if class loading failspublic void writeExternal(ObjectOutput out) throws IOException
Implementation method of interface Externalizable.
The first byte contains the type of the object to be serialized. Then the data bytes follow in a possibly bit-compressed representation.
writeReplace()-method of object
to be serializedIOException - in any case of IO-failuresprivate void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
20. Then the variant is written as UTF-String and finally
the days since UTC-epoch as long-primitive.int value
boolean leap
IndianMonth value
boolean leap
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
21. Then the variant is written as UTF-String.public void readExternal(ObjectInput in) throws IOException
Implementation method of interface Externalizable.
IOException - in any case of IO-failurespublic void writeExternal(ObjectOutput out) throws IOException
Implementation method of interface Externalizable.
The first byte contains the type of the object to be serialized. Then the data bytes follow in a possibly bit-compressed representation.
writeReplace()-method of object
to be serializedIOException - in any case of IO-failuresString name
int identity
int hash
long days
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
InvalidObjectException - if the state is inconsistentClassNotFoundException - if class-loading failsIOExceptionObject unit
long amount
> 0private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
3.
The following bits 4-7 contain the variant of history. The variant is usually
zero, but for PROLEPTIC_GREGORIAN 1, for PROLEPTIC_JULIAN 2, for PROLEPTIC_BYZANTINE 3,
for SWEDEN 4 and for the first gregorian reform 7. If the variant is zero then the
cutover date in question will be written as long (modified julian date) into the
stream. Then the sequence of eventually set ancient julian leap years will be
written as int-array (length followed by list of extended years). Then the specific
new-year-strategy will be written as count of list of rule-until-pairs followed by
the list entries. Finally the era preference will be written such that non-default
preferences require the byte 127 and else any other number. If non-default then
the preferred era and the start date and the end date will be written.public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
Implementation method of interface Externalizable.
IOException - in any case of IO-failuresClassNotFoundException - if class loading failspublic void writeExternal(ObjectOutput out) throws IOException
Implementation method of interface Externalizable.
The first byte contains within the 4 most-significant bits the type of the object to be serialized. Then the data bytes follow in a bit-compressed representation.
writeReplace()-method of object
to be serializedIOException - in any case of IO-failuresprivate void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
57. The lowest bit is
1 if this instance is infinite past. The bit (2)
will be set if this instance is infinite future. After this
header byte and in case of finite boundary, one byte
follows describing the open/closed-state. Finally the
bytes for the temporal follow.
Schematic algorithm:
int header = 57;
header <<= 2;
if (this == Boundary.infinitePast()) {
header |= 1;
out.writeByte(header);
} else if (this == Boundary.infiniteFuture()) {
header |= 2;
out.writeByte(header);
} else {
out.writeByte(header);
out.writeByte(isOpen() ? 1 : 0);
out.writeObject(getTemporal());
}
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
38. Then the year number
and the month number are written as int-primitives.
Schematic algorithm:
int header = 38; header <<= 2; out.writeByte(header); out.writeInt(getYear()); out.writeInt(getMonthOfYear().getValue());
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
37. Then the year number
and the quarter number are written as int-primitives.
Schematic algorithm:
int header = 37; header <<= 2; out.writeByte(header); out.writeInt(getYear()); out.writeInt(getQuarterOfYear().getValue());
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
39. Then the year number
and the quarter number are written as int-primitives.
Schematic algorithm:
int header = 39; header <<= 2; out.writeByte(header); out.writeInt(getYear()); out.writeInt(getWeek());
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
36. Then the year number
is written as int-primitive.
Schematic algorithm:
int header = 36; header <<= 2; out.writeByte(header); out.writeInt(getValue());
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
33 in the six most significant
bits. The next bytes represent the start and the end
boundary.
Schematic algorithm:
int header = 33;
header <<= 2;
out.writeByte(header);
writeBoundary(getStart(), out);
writeBoundary(getEnd(), out);
private static void writeBoundary(
Boundary<?> boundary,
ObjectOutput out
) throws IOException {
if (boundary.equals(Boundary.infinitePast())) {
out.writeByte(1);
} else if (boundary.equals(Boundary.infiniteFuture())) {
out.writeByte(2);
} else {
out.writeByte(boundary.isOpen() ? 4 : 0);
out.writeObject(boundary.getTemporal());
}
}
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
int header = 41;
header <<= 2;
out.writeByte(header);
out.writeInt(getIntervals().size());
for (ChronoInterval<?> part : getIntervals()) {
writeBoundary(part.getStart(), out);
writeBoundary(part.getEnd(), out);
}
private static void writeBoundary(
Boundary<?> boundary,
ObjectOutput out
) throws IOException {
if (boundary.equals(Boundary.infinitePast())) {
out.writeByte(1);
} else if (boundary.equals(Boundary.infiniteFuture())) {
out.writeByte(2);
} else {
out.writeByte(boundary.isOpen() ? 4 : 0);
out.writeObject(boundary.getTemporal());
}
}
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
32 in the six most significant
bits. The next bytes represent the start and the end
boundary.
Schematic algorithm:
int header = 32;
header <<= 2;
out.writeByte(header);
writeBoundary(getStart(), out);
writeBoundary(getEnd(), out);
private static void writeBoundary(
Boundary<?> boundary,
ObjectOutput out
) throws IOException {
if (boundary.equals(Boundary.infinitePast())) {
out.writeByte(1);
} else if (boundary.equals(Boundary.infiniteFuture())) {
out.writeByte(2);
} else {
out.writeByte(boundary.isOpen() ? 4 : 0);
out.writeObject(boundary.getTemporal());
}
}
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
int header = 40;
header <<= 2;
out.writeByte(header);
out.writeInt(getIntervals().size());
for (ChronoInterval<?> part : getIntervals()) {
writeBoundary(part.getStart(), out);
writeBoundary(part.getEnd(), out);
}
private static void writeBoundary(
Boundary<?> boundary,
ObjectOutput out
) throws IOException {
if (boundary.equals(Boundary.infinitePast())) {
out.writeByte(1);
} else if (boundary.equals(Boundary.infiniteFuture())) {
out.writeByte(2);
} else {
out.writeByte(boundary.isOpen() ? 4 : 0);
out.writeObject(boundary.getTemporal());
}
}
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
int header = 44;
header <<= 2;
out.writeByte(header);
out.writeObject(getTimeLine());
out.writeInt(getIntervals().size());
for (ChronoInterval<?< part : getIntervals()) {
out.writeObject(part.getStart().getTemporal());
out.writeObject(part.getEnd().getTemporal());
}
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
35 in the six most significant
bits. The next bytes represent the start and the end
boundary.
Schematic algorithm:
int header = 35;
header <<= 2;
out.writeByte(header);
writeBoundary(getStart(), out);
writeBoundary(getEnd(), out);
private static void writeBoundary(
Boundary<?> boundary,
ObjectOutput out
) throws IOException {
if (boundary.equals(Boundary.infinitePast())) {
out.writeByte(1);
} else if (boundary.equals(Boundary.infiniteFuture())) {
out.writeByte(2);
} else {
out.writeByte(boundary.isOpen() ? 4 : 0);
out.writeObject(boundary.getTemporal());
}
}
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
int header = 43;
header <<= 2;
out.writeByte(header);
out.writeInt(getIntervals().size());
for (ChronoInterval<?< part : getIntervals()) {
writeBoundary(part.getStart(), out);
writeBoundary(part.getEnd(), out);
}
private static void writeBoundary(
Boundary<?< boundary,
ObjectOutput out
) throws IOException {
if (boundary.equals(Boundary.infinitePast())) {
out.writeByte(1);
} else if (boundary.equals(Boundary.infiniteFuture())) {
out.writeByte(2);
} else {
out.writeByte(boundary.isOpen() ? 4 : 0);
out.writeObject(boundary.getTemporal());
}
}
final void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - in any case of inconsistenciesIOExceptionint amount
IsoDateUnit unit
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
Implementation method of interface Externalizable.
IOException - in case of I/O-problemsClassNotFoundException - if class-loading failspublic void writeExternal(ObjectOutput out) throws IOException
Implementation method of interface Externalizable.
The first byte contains within the 6 most-significant bits the type of the object to be serialized. Then the data bytes follow in a bit-compressed representation.
writeReplace()-method of object to be serializedIOException - in case of I/O-problemsprivate void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
34 in the six most significant
bits. The next bytes represent the start and the end
boundary.
Schematic algorithm:
int header = 34;
header <<= 2;
out.writeByte(header);
writeBoundary(getStart(), out);
writeBoundary(getEnd(), out);
private static void writeBoundary(
Boundary<?< boundary,
ObjectOutput out
) throws IOException {
if (boundary.equals(Boundary.infinitePast())) {
out.writeByte(1);
} else if (boundary.equals(Boundary.infiniteFuture())) {
out.writeByte(2);
} else {
out.writeByte(boundary.isOpen() ? 4 : 0);
out.writeObject(boundary.getTemporal());
}
}
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
int header = 42;
header <<= 2;
out.writeByte(header);
out.writeInt(getIntervals().size());
for (ChronoInterval<?> part : getIntervals()) {
writeBoundary(part.getStart(), out);
writeBoundary(part.getEnd(), out);
}
private static void writeBoundary(
Boundary<?> boundary,
ObjectOutput out
) throws IOException {
if (boundary.equals(Boundary.infinitePast())) {
out.writeByte(1);
} else if (boundary.equals(Boundary.infiniteFuture())) {
out.writeByte(2);
} else {
out.writeByte(boundary.isOpen() ? 4 : 0);
out.writeObject(boundary.getTemporal());
}
}
private void readObject(ObjectInputStream in) throws IOException
IOException - if the data are not consistentChronoInterval<T> interval
Object value
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
12. Then the
data bits for the id and the fallback timezone follow.
Schematic algorithm:
int header = (12 << 4);
out.writeByte(header);
out.writeObject(getID());
out.writeObject(getFallback());
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
14. If there is
a non-default transition strategy then the lowest bit is
set to 1 else to 0. After that the data bits
for the id, history and optionally the special strategy
follow.
Schematic algorithm:
boolean specialStrategy = (getStrategy() != Timezone.DEFAULT_CONFLICT_STRATEGY);
int header = (14 << 4);
if (specialStrategy) {
header |= 1;
}
out.writeByte(header);
out.writeObject(tz.getID());
out.writeObject(tz.getHistory());
if (specialStrategy) {
out.writeObject(tz.getStrategy());
}
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
InvalidObjectException - in case of inconsistenciesClassNotFoundException - if class-loading failsIOExceptionZonalOffset offset
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
Implementation method of interface Externalizable.
IOException - in case of I/O-problemsClassNotFoundException - if class-loading failspublic void writeExternal(ObjectOutput out) throws IOException
Implementation method of interface Externalizable.
The first byte contains within the 4 most-significant bits the type of the object to be serialized. Then the data bytes follow in a bit-compressed representation.
writeReplace()-method of object
to be serializedIOException - in case of I/O-problemsprivate void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
13. The lower
4 bits contain the concrete value of this strategy.
Schematic algorithm:
int key =
getGapResolver().ordinal() * 2 + getOverlapResolver().ordinal();
int header = (13 << 4);
header |= key;
out.writeByte(header);
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
15. If there is
any fractional part then the four least significant bits
are 1 else 0. After that the data bits
for the integral total shift and optionally the fractional
part follow.
Schematic algorithm:
boolean hasFraction = (this.getFractionalAmount() != 0);
int header = (15 << 4);
if (hasFraction) {
header |= 1;
}
out.writeByte(header);
out.writeInt(this.getIntegralAmount());
if (hasFraction) {
out.writeInt(this.getFractionalAmount());
}
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
IOException - in any case of inconsistenciesClassNotFoundException - if class-loading failslong posix
int previous
int total
int extra
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
126. Then the data bytes for the internal
transitions follow. The complex algorithm exploits the
fact that allmost all transitions happen at full hours
around midnight in local standard time. Insight in details
see source code.private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
127. Then the data bytes for the internal
transitions and rules follow. The complex algorithm
exploits the fact that allmost all transitions happen
at full hours around midnight in local standard time.
Insight in details see source code.private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
ZonalOffset offset
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
private void readObject(ObjectInputStream in) throws IOException
InvalidObjectException - (always)IOExceptionprivate Object writeReplace()
125. Then the data bytes for the internal
rules follow. The complex algorithm exploits the fact
that allmost all transitions happen at full hours around
midnight. Insight in details see source code.public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
Implementation method of interface Externalizable.
IOException - in case of I/O-problemsClassNotFoundException - if class-loading failspublic void writeExternal(ObjectOutput out) throws IOException
Implementation method of interface Externalizable.
The first byte contains the type of the object to be serialized. Then the data bytes follow in a bit-compressed representation.
writeReplace()-method of object
to be serializedIOException - in case of I/O-problemsprivate void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
ClassNotFoundException - if the class of a serialized object could not be found.IOException - if an I/O error occurs.IllegalArgumentException - in case of inconsistenciesString name
Copyright © 2014–2021. All rights reserved.