private 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()
7 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 = (7 << 2);
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()
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
Copyright © 2014–2018. All rights reserved.