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 <
You can also convert using Base64 encoding. To do this, you can use the javax.xml.bind.DatatypeConverter#printBase64Binary method.
For example:
byte[] salt = new byte[] { 50, 111, 8, 53, 86, 35, -19, -47 }; System.out.println(DatatypeConverter.printBase64Binary(salt));