Code example for ObjectInputStream

Methods: readDouble

0
   * @throws ClassNotFoundException if serialized object class cannot be found. 
   */ 
  public Object readObject (final ObjectInputStream in)
          throws IOException, ClassNotFoundException 
  { 
    final double x = in.readDouble();
    final double y = in.readDouble();
    return new Point2D.Double(x, y);
  } 
 
  /** 
   * Returns the class of the object, which this object can serialize. 
   * 
   * @return the class of java.awt.geom.Point2D. 
   */ 
  public Class getObjectClass ()
  { 
    return Point2D.class; 
  } 
}