日期:2014-05-20 浏览次数:20922 次
public static void main(String[] args) throws IOException {
String res = "<?xml version=\"1.0\" encoding=\"gb2312\"?><root><bb><cc>11</cc></bb></root>";
BASE64Encoder encoder = new BASE64Encoder();
String target = encoder.encode(res.getBytes());
BASE64Decoder decoder = new BASE64Decoder();
byte[] buf = decoder.decodeBuffer(target);
String str = new String(buf);
System.out.println(str);
}