String log = "";
BASE64Decoder decoder = new BASE64Decoder();
try {
log = new String(decoder.decodeBuffer(log));
System.out.println(log);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
BASE64Decoder decoder = new BASE64Decoder();
try {
log = new String(decoder.decodeBuffer(log));
System.out.println(log);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
如果直接将json字符串写在java代码里,处理json字符串中的双引号非常麻烦。这种先加密,后解密的方法巧妙的避开了这种困难。