/**
* 将 BASE64 编码的字符串 s 进行解码
*/
public static String decode(String s) {
if (s == null) {
// 非空
return null;
}
BASE64Decoder decoder = new BASE64Decoder();
try {
byte[] b = decoder.decodeBuffer(s);
// 转码
return new String(b, "UTF-8");
}
catch (Exception e) {
e.printStackTrace();
return null;
}
}