Code example for ObjectInputStream

Methods: readBoolean, readFloat, readObject

0
   * @throws ClassNotFoundException if serialized object class cannot be found. 
   */ 
  public Object readObject(final ObjectInputStream stream)
      throws IOException, ClassNotFoundException 
  { 
    final float x1 = stream.readFloat();
    final float y1 = stream.readFloat();
    final Color c1 = (Color) stream.readObject();
    final float x2 = stream.readFloat();
    final float y2 = stream.readFloat();
    final Color c2 = (Color) stream.readObject();
    final boolean isCyclic = stream.readBoolean();
    return new GradientPaint(x1, y1, c1, x2, y2, c2, isCyclic);
  } 
 
  /** 
   * The class of the object, which this object can serialize. 
   * 
   * @return the class of the object type, which this method handles. 
   */ 
  public Class getObjectClass()