* @return the created object, not null
   * @throws IOException if an error occurs
   */
  static StandardZoneRules readExternal(DataInput in) throws IOException, ClassNotFoundException {

    int stdSize = in.readInt();
    long[] stdTrans = new long[stdSize];
    for (int i = 0; i < stdSize; i++) {
      stdTrans[i] = Ser.readEpochSec(in);
    }
    ZoneOffset[] stdOffsets = new ZoneOffset[stdSize + 1];
    for (int i = 0; i < stdOffsets.length; i++) {
      stdOffsets[i] = Ser.readOffset(in);
    }
    int savSize = in.readInt();
    long[] savTrans = new long[savSize];
    for (int i = 0; i < savSize; i++) {
      savTrans[i] = Ser.readEpochSec(in);
    }
    ZoneOffset[] savOffsets = new ZoneOffset[savSize + 1];
    for (int i = 0; i < savOffsets.length; i++) {
      savOffsets[i] = Ser.readOffset(in);
    }
    int ruleSize = in.readByte();
    ZoneOffsetTransitionRule[] rules = new ZoneOffsetTransitionRule[ruleSize];
    for (int i = 0; i < ruleSize; i++) {
      rules[i] = ZoneOffsetTransitionRule.readExternal(in);
    }
    return new StandardZoneRules(stdTrans, stdOffsets, savTrans, savOffsets, rules);
  }