Java FileOutputStream Write saveBase64Str2Disk(String base64Str, File file)

Here you can find the source of saveBase64Str2Disk(String base64Str, File file)

Description

save Base Str Disk

License

Apache License

Declaration

public static void saveBase64Str2Disk(String base64Str, File file) throws IOException 

Method Source Code


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

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import sun.misc.BASE64Decoder;

public class Main {

    public static void saveBase64Str2Disk(String base64Str, File file) throws IOException {
        BASE64Decoder decoder = new BASE64Decoder();

        FileOutputStream write = new FileOutputStream(file);
        byte[] decoderBytes = decoder.decodeBuffer(base64Str);
        write.write(decoderBytes);/*from  ww w  . j  av  a 2s . c om*/
        write.close();
    }
}

Related

  1. save(String data, String encoding, String file)
  2. save(String f, byte[] data)
  3. save(String filename, byte[] bytes)
  4. save(String path, byte[] content, IProgressMonitor monitor)
  5. saveArray(byte[] pictureBytes, OutputStream stream)
  6. saveBase64strToFile(String base64Str, String filePath)
  7. saveBinaryFile(String fileName, byte[] buffer)
  8. saveByteArrayToFile(final File file, final byte[] array)
  9. saveByteFile(byte[] data, String filePath)