Code example for ObjectOutputStream

Methods: writeDouble, writeInt

0
   * @throws IOException if an I/O error occured. 
   */ 
  public void writeObject(final Object o, final ObjectOutputStream stream) throws IOException
  { 
    final Arc2D arc = (Arc2D) o;
    stream.writeDouble(arc.getX());
    stream.writeDouble(arc.getY());
    stream.writeDouble(arc.getWidth());
    stream.writeDouble(arc.getHeight());
    stream.writeDouble(arc.getAngleStart());
    stream.writeDouble(arc.getAngleExtent());
    stream.writeInt(arc.getArcType());
  } 
 
  /** 
   * Reads the object from the object input stream. 
   * 
   * @param stream the object input stream from where to read the serialized data. 
   * @return the generated object. 
   * @throws IOException            if reading the stream failed. 
   * @throws ClassNotFoundException if serialized object class cannot be found.