I need to encode some data in the Base64 encoding in Java. How do I do that? What is the name of the class that provides a Base64 encoder?
I tried to use the <
In Java 7 I coded this method
import javax.xml.bind.DatatypeConverter; public static String toBase64(String data) { return DatatypeConverter.printBase64Binary(data.getBytes()); }