private static String toString(Serializable o) throws IOException {
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  ObjectOutputStream oos=new ObjectOutputStream(baos);
  oos.writeObject(o);
  oos.close();
  return new String(Base64.encode(baos.toByteArray(),Base64.DEFAULT));
}

private static String toString ( Serializable o ) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; ObjectOutputStream oos = new ObjectOutputStream ( baos ) ; oos . writeObject ( o ) ; oos . close ( ) ; return new String ( Base64 . encode ( baos . toByteArray ( ) , Base64 . DEFAULT ) ) ; }
write the object to a base64 string .
