Java FileOutputStream Write save(byte[] bs, String fn)

Here you can find the source of save(byte[] bs, String fn)

Description

save

License

Open Source License

Declaration

public static void save(byte[] bs, String fn) throws IOException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.BufferedOutputStream;

import java.io.File;

import java.io.FileOutputStream;
import java.io.IOException;

public class Main {
    public static void save(byte[] bs, String fn) throws IOException {
        new File(fn).getParentFile().mkdirs();
        BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(fn));
        out.write(bs);/*w  w w  .  jav  a 2s .com*/
        out.close();
    }
}

Related

  1. copyFile(InputStream input, OutputStream output)
  2. copyFile(InputStream sourceFileIs, File destDirFile, String destFileName)
  3. copyFileFromAssets(InputStream inputStream, String pathToWrite)
  4. copyFileUsingFileStreams(InputStream source, File dest)
  5. copyFileUsingStream(InputStream sourceStream, File dest)
  6. save(byte[] bytes, File path)
  7. save(byte[] data, String path)
  8. save(File file, byte[] bytes)
  9. save(File file, byte[] content)