question: private void writeObject ( ObjectOutputStream objectstream ) throws IOException { objectstream . defaultWriteObject ( ) ; PixelGrabber grabber = new PixelGrabber ( bitmap , 0 , 0 , - 1 , - 1 , true ) ; if ( colorModel == COLORMODEL_IMAGEICON && bitmap != null ) { try { grabber . grabPixels ( ) ; } catch ( InterruptedException e ) { logger . fine ( "error grabbing pixels" ) ; } Object pix = grabber . getPixels ( ) ; Dimension dim = new Dimension ( bitmap . getWidth ( this ) , bitmap . getHeight ( this ) ) ; objectstream . writeObject ( dim ) ; objectstream . writeObject ( pix ) ; } }
target:  Code derived from http://www.dcs.shef.ac.uk/~tom/Java/Power/image_serialization.html