code: public static String encodeToString(byte[] input, int flags) {
      try {
        return new String(encode(input, flags), "US-ASCII");
      } catch (UnsupportedEncodingException e) {
        // US-ASCII is guaranteed to be available.
        throw new AssertionError(e);
      }
    }
docs: Base64-encode the given data and return a newly allocated
  String with the result.
  
  @param input  the data to encode
  @param flags  controls certain features of the encoded output.
  Passing {@code DEFAULT} results in output that
  adheres to RFC 2045.