import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import sun.misc.BASE64Decoder; public String getPicFromStreams() { String str ;//存放二进制的流 BASE64Decoder decoder=new BASE64Decoder(); byte[] bytes; try { bytes = decoder.decodeBuffer(str); File file=new File("E:/MYTESTPIC.jpeg"); FileOutputStream fos=new FileOutputStream(file); fos.write(bytes); fos.flush(); fos.close(); } catch (IOException e) { e.printStackTrace(); } return null; }
本文出自 “流苏” 博客,请务必保留此出处http://byliusu.blog.51cto.com/8895219/1420954