Here you can find the source of toBase64(final String str)
Parameter | Description |
---|---|
str | The String to encode. |
public static String toBase64(final String str)
//package com.java2s; //License from project: Apache License import java.util.Base64; public class Main { /**// ww w . ja v a2s .com * Convert a {@code String} into its base64 representation. * * @param str * The {@code String} to encode. * @return The encoded {@link String}. */ public static String toBase64(final String str) { final String res64 = Base64.getEncoder().encodeToString(str.getBytes()); return (res64); } }