spring常用工具類,引入spring即可使用Base64Utils
byte[] encode(byte[] src) 字節數組編碼後並返回
byte[] decode(byte[] src) 字節數組解碼後並返回
String encodeToString(byte[] src) 字節數組編碼後並返回字符串
byte[] decodeFromString(String src) 字符串解碼後並返回字節數組
對URL進行編碼解碼,使用下面的方法:
byte[] encodeUrlSafe(byte[] src) 字節數組編碼後並返回
byte[] decodeUrlSafe(byte[] src) 字節數組解碼後並返回
String encodeToUrlSafeString(byte[] src) 字節數組編碼後並返回字符串
byte[] decodeFromUrlSafeString(String src) 字符串解碼後並返回字節數組