Base64 encoder and decoder

This is an example of how to use the Base64 class to encode and decode a simple String value. // String to be encoded with Base64 String text = “Test”; // Sending side byte[] data = null; try { data = text.getBytes(“UTF-8”); } catch (UnsupportedEncodingException e1) { e1.printStackTrace(); } String base64 = Base64.encodeToString(data, Base64.DEFAULT); // … Read more