public static void save ( Object o , OutputStream stream ) { try { ObjectOutputStream outStream = ( stream instanceof ObjectOutputStream ) ? ( ObjectOutputStream ) stream : new ObjectOutputStream ( stream ) ; outStream . writeObject ( o ) ; } catch ( IOException ioe ) { throw new IOError ( ioe ) ; } }
Serializes the object to the provided stream . This method does not close the stream after writing .