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 <
Simple example with Java 8:
import java.util.Base64; String str = "your string"; String encodedStr = Base64.getEncoder().encodeToString(str.getBytes("utf-8"));