I have an image that is Base64 encoded. What is the best way to decode that in Java? Hopefully using only the libraries included with Sun Java 6.
This is a late answer, but Joshua Bloch committed his Base64
class (when he was working for Sun, ahem, Oracle) under the java.util.prefs
package. This class existed since JDK 1.4.
E.g.
String currentString = "Hello World";
String base64String = java.util.prefs.Base64.byteArrayToBase64(currentString.getBytes("UTF-8"));