/** * Base 64 encode as described in RFC 1421. * <p>Does not insert whitespace as described in RFC 1521. * @param s String to encode. * @return String containing the encoded form of the input. */ static public String encode(String s) { try { return encode(s,null); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException(e.toString()); } }
/** * Base 64 encode as described in RFC 1421. * <p>Does not insert whitespace as described in RFC 1521. * @param s String to encode. * @return String containing the encoded form of the input. */ static public String encode(String s) { try { return encode(s,null); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException(e.toString()); } }
/** * Base 64 encode as described in RFC 1421. * <p>Does not insert whitespace as described in RFC 1521. * @param s String to encode. * @param charEncoding String representing the name of * the character encoding of the provided input String. * @return String containing the encoded form of the input. */ static public String encode(String s,String charEncoding) throws UnsupportedEncodingException { byte[] bytes; if (charEncoding==null) bytes=s.getBytes(StringUtil.__ISO_8859_1); else bytes=s.getBytes(charEncoding); return new String(encode(bytes)); }
/** * Base 64 encode as described in RFC 1421. * <p>Does not insert whitespace as described in RFC 1521. * @param s String to encode. * @param charEncoding String representing the name of * the character encoding of the provided input String. * @return String containing the encoded form of the input. */ static public String encode(String s,String charEncoding) throws UnsupportedEncodingException { byte[] bytes; if (charEncoding==null) bytes=s.getBytes(StringUtil.__ISO_8859_1); else bytes=s.getBytes(charEncoding); return new String(encode(bytes)); }
return new String(B64Code.encode(nounce));
return new String(B64Code.encode(nounce));