Code example for ObjectInputStream

Methods: readFloat, readInt, readObject

0
   * @throws ClassNotFoundException if serialized object class cannot be found. 
   */ 
  public Object readObject (final ObjectInputStream stream)
          throws IOException, ClassNotFoundException 
  { 
    final float width = stream.readFloat();
    final int cap = stream.readInt();
    final int join = stream.readInt();
    final float miterLimit = stream.readFloat();
    final float[] dash = (float[]) stream.readObject();
    final float dashPhase = stream.readFloat();
    //noinspection MagicConstant 
    return new BasicStroke(width, cap, join, miterLimit, dash, dashPhase);
  } 
 
  /** 
   * The class of the object, which this object can serialize. 
   * 
   * @return the class <code>java.awt.BasicStroke</code>. 
   */ 
  public Class getObjectClass ()