public static String encode ( String string ) { byte [ ] bytes ; try { bytes = string . getBytes ( PREFERRED_ENCODING ) ; } catch ( UnsupportedEncodingException uee ) { bytes = string . getBytes ( ) ; } return encodeBytes ( bytes ) ; }
Encode string as a byte array in Base64 annotation .