public void writeToStream ( OutputStream stream , Object object ) throws SerializationException { try { mapper . writeValue ( stream , object ) ; } catch ( IOException ex ) { throw new SerializationException ( "Exception during serialization" , ex ) ; } }
Write the object to the stream .