Java Base64 Convert to base64ToFile(String base64Code, String targetPath)

Here you can find the source of base64ToFile(String base64Code, String targetPath)

Description

base64 code save to file

License

Apache License

Parameter

Parameter Description
base64Code a parameter
targetPath a parameter

Exception

Parameter Description
Exception an exception

Declaration


public static void base64ToFile(String base64Code, String targetPath) throws Exception 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.FileOutputStream;

public class Main {
    /**//from ww  w. j a  v a 2s  .  c o  m
     * base64 code save to file
     * 
     * @param base64Code
     * @param targetPath
     * @throws Exception
     */

    public static void base64ToFile(String base64Code, String targetPath) throws Exception {
        byte[] buffer = base64Code.getBytes();
        FileOutputStream out = new FileOutputStream(targetPath);
        out.write(buffer);
        out.close();
    }
}

Related

  1. base642byte(String base64)
  2. base64StrToStream(String base64Str)
  3. base64ToByte(String data)
  4. base64ToByteArray(String data)
  5. fromBase64(byte[] buf, int start, int length)
  6. fromBase64(final String encoded)
  7. fromBase64(final String input)
  8. fromBase64(String base64)