MCPcopy Create free account
hub / github.com/MenoData/Time4J / writeMachineTime

Method writeMachineTime

base/src/main/java/net/time4j/SPX.java:609–630  ·  view source on GitHub ↗
(ObjectOutput out)

Source from the content-addressed store, hash-verified

607 }
608
609 private void writeMachineTime(ObjectOutput out)
610 throws IOException {
611
612 MachineTime<?> mt = MachineTime.class.cast(this.obj);
613 int header = MACHINE_TIME_TYPE;
614 header <<= 4;
615
616 if (mt.getScale() == TimeScale.UTC) {
617 header |= 1;
618 }
619
620 if (mt.getFraction() == 0) {
621 out.writeByte(header);
622 out.writeLong(mt.getSeconds());
623 } else {
624 header |= 2;
625 out.writeByte(header);
626 out.writeLong(mt.getSeconds());
627 out.writeInt(mt.getFraction());
628 }
629
630 }
631
632 private Object readMachineTime(
633 ObjectInput in,

Callers 1

writeExternalMethod · 0.95

Calls 4

castMethod · 0.45
getScaleMethod · 0.45
getFractionMethod · 0.45
getSecondsMethod · 0.45

Tested by

no test coverage detected