code: public static String encode( String string ) {
          byte[] bytes;
          try {
              bytes = string.getBytes(PREFERRED_ENCODING);
          } catch( UnsupportedEncodingException uee ) {
              bytes = string.getBytes();
          }
          return encodeBytes(bytes);
      }
docs: Encode string as a byte array in Base64 annotation.
  
  @param string
  @return The Base64-encoded data as a string