Base64字符解码保存文件

Base64字符解码保存文件

 /**
     * 将base64字符解码保存文件
     * @param base64Code
     * @param targetPath
     * @throws Exception
     */

    public void decoderBase64File(String base64Code, String targetPath)
            throws Exception, IOException {
        byte[] buffer = new BASE64Decoder().decodeBuffer(base64Code);
        FileOutputStream out = new FileOutputStream(targetPath);
        out.write(buffer);
        out.close();
    }

猜你喜欢

转载自crabdave.iteye.com/blog/2338333