(
ObjectInput in,
byte header
)
| 578 | } |
| 579 | |
| 580 | @SuppressWarnings("unchecked") |
| 581 | private Object readDayPeriod( |
| 582 | ObjectInput in, |
| 583 | byte header |
| 584 | ) throws IOException, ClassNotFoundException { |
| 585 | |
| 586 | boolean fixed = ((header & 1) == 1); |
| 587 | boolean custom = ((header & 2) == 2); |
| 588 | |
| 589 | if (custom) { |
| 590 | Map<PlainTime, String> timeToLabels = (Map<PlainTime, String>) in.readObject(); |
| 591 | return new DayPeriod.Element(fixed, DayPeriod.of(timeToLabels)); |
| 592 | } |
| 593 | |
| 594 | String langCode = in.readUTF(); |
| 595 | String calendarType = in.readUTF(); |
| 596 | int index = langCode.indexOf("-"); |
| 597 | Locale locale; |
| 598 | |
| 599 | if (index == -1) { |
| 600 | locale = new Locale(langCode); |
| 601 | } else { |
| 602 | locale = new Locale(langCode.substring(0, index), langCode.substring(index + 1)); |
| 603 | } |
| 604 | |
| 605 | return new DayPeriod.Element(fixed, locale, calendarType); |
| 606 | |
| 607 | } |
| 608 | |
| 609 | private void writeMachineTime(ObjectOutput out) |
| 610 | throws IOException { |
no test coverage detected