question: public static String serializeToString ( Object object ) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; ObjectOutputStream oos = new ObjectOutputStream ( baos ) ; oos . writeObject ( object ) ; oos . close ( ) ; return Base64 . encode ( baos . toByteArray ( ) ) ; }
target:  Serialize an object to a string