public static String strConvertBase(String str) {
if(null != str){
Base64.Encoder encoder = Base64.getEncoder();
return encoder.encodeToString(str.getBytes());
}
return null;
}
public static String baseConvertStr(String str) {
if(null != str){
Base64.Decoder decoder = Base64.getDecoder();
try {
return new String(decoder.decode(str.getBytes()), "GBK");
} catch (UnsupportedEncodingException e) {
return null;
}
}
return null;
}