Base64工具

类名:Base64Util

encode

/**
 * 编码
 *
 * @param value 字符串
 * @return {String}
 */
Base64Util.encode(String value);

encode

/**
 * 编码
 *
 * @param value   字符串
 * @param charset 字符集
 * @return {String}
 */
Base64Util.encode(String value, java.nio.charset.Charset charset);

encodeUrlSafe

/**
 * 编码URL安全
 *
 * @param value 字符串
 * @return {String}
 */
Base64Util.encodeUrlSafe(String value);

encodeUrlSafe

/**
 * 编码URL安全
 *
 * @param value   字符串
 * @param charset 字符集
 * @return {String}
 */
Base64Util.encodeUrlSafe(String value, java.nio.charset.Charset charset);

decode

/**
 * 解码
 *
 * @param value 字符串
 * @return {String}
 */
Base64Util.decode(String value);

decode

/**
 * 解码
 *
 * @param value   字符串
 * @param charset 字符集
 * @return {String}
 */
Base64Util.decode(String value, java.nio.charset.Charset charset);

decodeUrlSafe

/**
 * 解码URL安全
 *
 * @param value 字符串
 * @return {String}
 */
Base64Util.decodeUrlSafe(String value);

decodeUrlSafe

/**
 * 解码URL安全
 *
 * @param value   字符串
 * @param charset 字符集
 * @return {String}
 */
Base64Util.decodeUrlSafe(String value, java.nio.charset.Charset charset);

encode

/**
 * Base64-encode the given byte array.
 * @param src the original byte array
 * @return the encoded byte array
 */
Base64Util.encode(byte[] src);

decode

/**
 * Base64-decode the given byte array.
 * @param src the encoded byte array
 * @return the original byte array
 */
Base64Util.decode(byte[] src);

encodeUrlSafe

/**
 * Base64-encode the given byte array using the RFC 4648
 * "URL and Filename Safe Alphabet".
 * @param src the original byte array
 * @return the encoded byte array
 * @since 4.2.4
 */
Base64Util.encodeUrlSafe(byte[] src);

decodeUrlSafe

/**
 * Base64-decode the given byte array using the RFC 4648
 * "URL and Filename Safe Alphabet".
 * @param src the encoded byte array
 * @return the original byte array
 * @since 4.2.4
 */
Base64Util.decodeUrlSafe(byte[] src);

encodeToString

/**
 * Base64-encode the given byte array to a String.
 * @param src the original byte array
 * @return the encoded byte array as a UTF-8 String
 */
Base64Util.encodeToString(byte[] src);

decodeFromString

/**
 * Base64-decode the given byte array from an UTF-8 String.
 * @param src the encoded UTF-8 String
 * @return the original byte array
 */
Base64Util.decodeFromString(String src);

encodeToUrlSafeString

/**
 * Base64-encode the given byte array to a String using the RFC 4648
 * "URL and Filename Safe Alphabet".
 * @param src the original byte array
 * @return the encoded byte array as a UTF-8 String
 */
Base64Util.encodeToUrlSafeString(byte[] src);

decodeFromUrlSafeString

/**
 * Base64-decode the given byte array from an UTF-8 String using the RFC 4648
 * "URL and Filename Safe Alphabet".
 * @param src the encoded UTF-8 String
 * @return the original byte array
 */
Base64Util.decodeFromUrlSafeString(String src);