jdk/src/share/classes/java/time/Duration.java
changeset 19841 15c8e97d6a14
parent 19030 32f129cb6351
child 20520 0952771e3e25
equal deleted inserted replaced
19822:4e10a58fa28f 19841:15c8e97d6a14
    72 
    72 
    73 import java.io.DataInput;
    73 import java.io.DataInput;
    74 import java.io.DataOutput;
    74 import java.io.DataOutput;
    75 import java.io.IOException;
    75 import java.io.IOException;
    76 import java.io.InvalidObjectException;
    76 import java.io.InvalidObjectException;
    77 import java.io.ObjectStreamException;
    77 import java.io.InvalidObjectException;
    78 import java.io.Serializable;
    78 import java.io.Serializable;
    79 import java.math.BigDecimal;
    79 import java.math.BigDecimal;
    80 import java.math.BigInteger;
    80 import java.math.BigInteger;
    81 import java.math.RoundingMode;
    81 import java.math.RoundingMode;
    82 import java.time.format.DateTimeParseException;
    82 import java.time.format.DateTimeParseException;
  1297 
  1297 
  1298     //-----------------------------------------------------------------------
  1298     //-----------------------------------------------------------------------
  1299     /**
  1299     /**
  1300      * Writes the object using a
  1300      * Writes the object using a
  1301      * <a href="../../serialized-form.html#java.time.Ser">dedicated serialized form</a>.
  1301      * <a href="../../serialized-form.html#java.time.Ser">dedicated serialized form</a>.
       
  1302      * @serialData
  1302      * <pre>
  1303      * <pre>
  1303      *  out.writeByte(1);  // identifies this as a Duration
  1304      *  out.writeByte(1);  // identifies a Duration
  1304      *  out.writeLong(seconds);
  1305      *  out.writeLong(seconds);
  1305      *  out.writeInt(nanos);
  1306      *  out.writeInt(nanos);
  1306      * </pre>
  1307      * </pre>
  1307      *
  1308      *
  1308      * @return the instance of {@code Ser}, not null
  1309      * @return the instance of {@code Ser}, not null
  1314     /**
  1315     /**
  1315      * Defend against malicious streams.
  1316      * Defend against malicious streams.
  1316      * @return never
  1317      * @return never
  1317      * @throws InvalidObjectException always
  1318      * @throws InvalidObjectException always
  1318      */
  1319      */
  1319     private Object readResolve() throws ObjectStreamException {
  1320     private Object readResolve() throws InvalidObjectException {
  1320         throw new InvalidObjectException("Deserialization via serialization delegate");
  1321         throw new InvalidObjectException("Deserialization via serialization delegate");
  1321     }
  1322     }
  1322 
  1323 
  1323     void writeExternal(DataOutput out) throws IOException {
  1324     void writeExternal(DataOutput out) throws IOException {
  1324         out.writeLong(seconds);
  1325         out.writeLong(seconds);