(
ObjectInput in,
byte header
)
| 525 | } |
| 526 | |
| 527 | private Object readDuration( |
| 528 | ObjectInput in, |
| 529 | byte header |
| 530 | ) throws IOException, ClassNotFoundException { |
| 531 | |
| 532 | boolean useLong = ((header & 0xF) == 1); |
| 533 | int size = in.readInt(); |
| 534 | |
| 535 | if (size == 0) { |
| 536 | return Duration.ofZero(); |
| 537 | } |
| 538 | |
| 539 | List<TimeSpan.Item<IsoUnit>> items = new ArrayList<>(size); |
| 540 | |
| 541 | for (int i = 0; i < size; i++) { |
| 542 | long amount = (useLong ? in.readLong() : in.readInt()); |
| 543 | IsoUnit unit = (IsoUnit) in.readObject(); |
| 544 | items.add(TimeSpan.Item.of(amount, unit)); |
| 545 | } |
| 546 | |
| 547 | boolean negative = in.readBoolean(); |
| 548 | return new Duration<>(items, negative); |
| 549 | } |
| 550 | |
| 551 | private void writeDayPeriod(ObjectOutput out) |
| 552 | throws IOException { |
no test coverage detected