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

Method readMachineTime

base/src/main/java/net/time4j/SPX.java:632–648  ·  view source on GitHub ↗
(
        ObjectInput in,
        byte header
    )

Source from the content-addressed store, hash-verified

630 }
631
632 private Object readMachineTime(
633 ObjectInput in,
634 byte header
635 ) throws IOException {
636
637 TimeScale scale = (
638 ((header & 0x1) == 1) ? TimeScale.UTC : TimeScale.POSIX);
639 long secs = in.readLong();
640 int fraction = (((header & 0x2) == 2) ? in.readInt() : 0);
641
642 if (scale == TimeScale.UTC) {
643 return MachineTime.ofSIUnits(secs, fraction);
644 } else {
645 return MachineTime.ofPosixUnits(secs, fraction);
646 }
647
648 }
649
650}

Callers 1

readExternalMethod · 0.95

Calls 2

ofSIUnitsMethod · 0.95
ofPosixUnitsMethod · 0.95

Tested by

no test coverage detected