private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
  stream.defaultReadObject();
  int paintCount=stream.readInt();
  this.paintSequence=new Paint[paintCount];
  for (int i=0; i < paintCount; i++) {
    this.paintSequence[i]=SerialUtilities.readPaint(stream);
  }
  int outlinePaintCount=stream.readInt();
  this.outlinePaintSequence=new Paint[outlinePaintCount];
  for (int i=0; i < outlinePaintCount; i++) {
    this.outlinePaintSequence[i]=SerialUtilities.readPaint(stream);
  }
  int strokeCount=stream.readInt();
  this.strokeSequence=new Stroke[strokeCount];
  for (int i=0; i < strokeCount; i++) {
    this.strokeSequence[i]=SerialUtilities.readStroke(stream);
  }
  int outlineStrokeCount=stream.readInt();
  this.outlineStrokeSequence=new Stroke[outlineStrokeCount];
  for (int i=0; i < outlineStrokeCount; i++) {
    this.outlineStrokeSequence[i]=SerialUtilities.readStroke(stream);
  }
  int shapeCount=stream.readInt();
  this.shapeSequence=new Shape[shapeCount];
  for (int i=0; i < shapeCount; i++) {
    this.shapeSequence[i]=SerialUtilities.readShape(stream);
  }
}

private void readObject ( ObjectInputStream stream ) throws IOException , ClassNotFoundException { stream . defaultReadObject ( ) ; int paintCount = stream . readInt ( ) ; this . paintSequence = new Paint [ paintCount ] ; for ( int i = 0 ; i < paintCount ; i ++ ) { this . paintSequence [ i ] = SerialUtilities . readPaint ( stream ) ; } int outlinePaintCount = stream . readInt ( ) ; this . outlinePaintSequence = new Paint [ outlinePaintCount ] ; for ( int i = 0 ; i < outlinePaintCount ; i ++ ) { this . outlinePaintSequence [ i ] = SerialUtilities . readPaint ( stream ) ; } int strokeCount = stream . readInt ( ) ; this . strokeSequence = new Stroke [ strokeCount ] ; for ( int i = 0 ; i < strokeCount ; i ++ ) { this . strokeSequence [ i ] = SerialUtilities . readStroke ( stream ) ; } int outlineStrokeCount = stream . readInt ( ) ; this . outlineStrokeSequence = new Stroke [ outlineStrokeCount ] ; for ( int i = 0 ; i < outlineStrokeCount ; i ++ ) { this . outlineStrokeSequence [ i ] = SerialUtilities . readStroke ( stream ) ; } int shapeCount = stream . readInt ( ) ; this . shapeSequence = new Shape [ shapeCount ] ; for ( int i = 0 ; i < shapeCount ; i ++ ) { this . shapeSequence [ i ] = SerialUtilities . readShape ( stream ) ; } }
restores a serialized object .
