Code example for ObjectInputStream

Methods: readDouble

   * @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; 
Stop searching for code, let great code find you!  Add Codota to your java IDE