【Base64編碼,解碼】Base64Utils

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) 字符串解碼後並返回字節數組

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章