Here you can find the source of saveBase64strToFile(String base64Str, String filePath)
public static void saveBase64strToFile(String base64Str, String filePath) throws IOException
//package com.java2s; //License from project: Open Source License import sun.misc.BASE64Decoder; import java.io.*; public class Main { public static void saveBase64strToFile(String base64Str, String filePath) throws IOException { BASE64Decoder decoder = new BASE64Decoder(); byte[] b = decoder.decodeBuffer(base64Str); for (int i = 0; i < b.length; ++i) { if (b[i] < 0) { b[i] += 256;/* w w w. j a v a 2 s . co m*/ } } OutputStream out = new FileOutputStream(filePath); out.write(b); out.flush(); out.close(); } }