Base64 en Java

String originalInput = "test input";
String encodedString = Base64.getEncoder().encodeToString(originalInput.getBytes());
Defiant Dove