List of utility methods to do String Encode
String | encode(String s) encode StringBuffer stringbuffer = new StringBuffer(); int i = s.length(); for (int j = 0; j < i; j++) { int k = s.charAt(j); if (65 <= k && k <= 90) stringbuffer.append((char) k); else if (97 <= k && k <= 122) stringbuffer.append((char) k); ... |
String | encodeCredentials(String username, String password) encode Credentials String cred = username + ":" + password; String encodedValue = null; byte[] encodedBytes = Base64 .encode(cred.getBytes(), Base64.NO_WRAP); encodedValue = new String(encodedBytes); System.out.println("encodedBytes " + new String(encodedBytes)); byte[] decodedBytes = Base64.decode(encodedBytes, Base64.NO_WRAP); System.out.println("decodedBytes " + new String(decodedBytes)); ... |