question: public static String convertObjectToString ( Object obj ) throws IOException { ByteArrayOutputStream baos = null ; GZIPOutputStream gos = null ; ObjectOutputStream oos = null ; try { baos = new ByteArrayOutputStream ( ) ; gos = new GZIPOutputStream ( baos ) ; oos = new ObjectOutputStream ( gos ) ; oos . writeObject ( obj ) ; } finally { try { if ( oos != null ) { oos . close ( ) ; } if ( gos != null ) { gos . close ( ) ; } if ( baos != null ) { baos . close ( ) ; } } catch ( IOException e ) { LOG . error ( e ) ; } } return new String ( Base64 . encodeBase64 ( baos . toByteArray ( ) ) , "UTF-8" ) ; }
target:  Convert object to Base64 String