Code example for ObjectOutputStream

Methods: writeFloat, writeInt, writeObject

0
   */ 
  public void writeObject (final Object o, final ObjectOutputStream stream)
          throws IOException 
  { 
    final BasicStroke s = (BasicStroke) o;
    stream.writeFloat(s.getLineWidth());
    stream.writeInt(s.getEndCap());
    stream.writeInt(s.getLineJoin());
    stream.writeFloat(s.getMiterLimit());
    stream.writeObject(s.getDashArray());
    stream.writeFloat(s.getDashPhase());
  } 
 
  /** 
   * 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.