code: private void writeObject(ObjectOutputStream stream)
           throws IOException
      {
          // Construct a binary rule
          byte[] rules = packRules();
          int[] times = packTimes();
  
          // Convert to 1.1 FCS rules.  This step may cause us to lose information.
          makeRulesCompatible();
  
          // Write out the 1.1 FCS rules
          stream.defaultWriteObject();
  
          // Write out the binary rules in the optional data area of the stream.
          stream.writeInt(rules.length);
          stream.write(rules);
          stream.writeObject(times);
  
          // Recover the original rules.  This recovers the information lost
          // by makeRulesCompatible.
          unpackRules(rules);
          unpackTimes(times);
      }
docs: Save the state of this object to a stream (i.e., serialize it).
  
  @serialData We write out two formats, a JDK 1.1 compatible format, using
  <code>DOW_IN_MONTH_MODE</code> rules, in the required section, followed
  by the full rules, in packed format, in the optional section.  The
  optional section will be ignored by JDK 1.1 code upon stream in.
  <p> Contents of the optional section: The length of a byte array is
  emitted (int); this is 4 as of this release. The byte array of the given
  length is emitted. The contents of the byte array are the true values of
  the fields <code>startDay</code>, <code>startDayOfWeek</code>,
  <code>endDay</code>, and <code>endDayOfWeek</code>.  The values of these
  fields in the required section are approximate values suited to the rule
  mode <code>DOW_IN_MONTH_MODE</code>, which is the only mode recognized by
  JDK 1.1.