jdk/src/share/classes/java/time/YearMonth.java
changeset 19841 15c8e97d6a14
parent 19030 32f129cb6351
child 20520 0952771e3e25
equal deleted inserted replaced
19822:4e10a58fa28f 19841:15c8e97d6a14
    75 
    75 
    76 import java.io.DataInput;
    76 import java.io.DataInput;
    77 import java.io.DataOutput;
    77 import java.io.DataOutput;
    78 import java.io.IOException;
    78 import java.io.IOException;
    79 import java.io.InvalidObjectException;
    79 import java.io.InvalidObjectException;
    80 import java.io.ObjectStreamException;
    80 import java.io.InvalidObjectException;
    81 import java.io.Serializable;
    81 import java.io.Serializable;
    82 import java.time.chrono.Chronology;
    82 import java.time.chrono.Chronology;
    83 import java.time.chrono.IsoChronology;
    83 import java.time.chrono.IsoChronology;
    84 import java.time.format.DateTimeFormatter;
    84 import java.time.format.DateTimeFormatter;
    85 import java.time.format.DateTimeFormatterBuilder;
    85 import java.time.format.DateTimeFormatterBuilder;
  1203     }
  1203     }
  1204 
  1204 
  1205     //-----------------------------------------------------------------------
  1205     //-----------------------------------------------------------------------
  1206     /**
  1206     /**
  1207      * Writes the object using a
  1207      * Writes the object using a
  1208      * <a href="../../../serialized-form.html#java.time.temporal.Ser">dedicated serialized form</a>.
  1208      * <a href="../../serialized-form.html#java.time.Ser">dedicated serialized form</a>.
       
  1209      * @serialData
  1209      * <pre>
  1210      * <pre>
  1210      *  out.writeByte(12);  // identifies this as a YearMonth
  1211      *  out.writeByte(12);  // identifies a YearMonth
  1211      *  out.writeInt(year);
  1212      *  out.writeInt(year);
  1212      *  out.writeByte(month);
  1213      *  out.writeByte(month);
  1213      * </pre>
  1214      * </pre>
  1214      *
  1215      *
  1215      * @return the instance of {@code Ser}, not null
  1216      * @return the instance of {@code Ser}, not null
  1221     /**
  1222     /**
  1222      * Defend against malicious streams.
  1223      * Defend against malicious streams.
  1223      * @return never
  1224      * @return never
  1224      * @throws InvalidObjectException always
  1225      * @throws InvalidObjectException always
  1225      */
  1226      */
  1226     private Object readResolve() throws ObjectStreamException {
  1227     private Object readResolve() throws InvalidObjectException {
  1227         throw new InvalidObjectException("Deserialization via serialization delegate");
  1228         throw new InvalidObjectException("Deserialization via serialization delegate");
  1228     }
  1229     }
  1229 
  1230 
  1230     void writeExternal(DataOutput out) throws IOException {
  1231     void writeExternal(DataOutput out) throws IOException {
  1231         out.writeInt(year);
  1232         out.writeInt(year);