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();
    final double w = in.readDouble();
    final double h = in.readDouble();
    return new Rectangle2D.Double(x, y, w, h);
  } 
 
  /** 
   * Returns the class of the object, which this object can serialize. 
   * 
   * @return the class of java.awt.geom.Rectangle2D. 
   */ 
  public Class getObjectClass ()
  { 
    return Rectangle2D.class; 
  }