当前位置:首页 > BASE64编解码java
importjava.io.BufferedOutputStream; import java.io.IOException; importjava.io.OutputStream;
import sun.misc.BASE64Decoder; import sun.misc.BASE64Encoder; importnet.sf.json.JSONObject;
publicclass Test { /**
* @param args
* fromObject 的使用,可以将string转成jsonobject */
publicstaticvoid main(String[] args) { // TODO Auto-generated method stub }
String wxImgBase64 = new
System.out.println(wxImgBase64); //将字符串转换为byte数组 try { }
byte[] bytes = new BASE64Decoder().decodeBuffer(wxImgBase64); System.out.println(new String(bytes)); // TODO Auto-generated catch block e.printStackTrace();
BASE64Encoder().encodeBuffer(\.getBytes());
} catch (IOException e) {
}
共分享92篇相关文档