public static String btoa(final String strToEncode) throws UnsupportedEncodingException {
  return Base64.encodeBytes(strToEncode.getBytes("UTF-8"));
}

public static String btoa ( final String strToEncode ) throws UnsupportedEncodingException { return Base64 . encodeBytes ( strToEncode . getBytes ( "UTF-8" ) ) ; }
encodes a string with base64 .
