Java Write Byte Array to File writeFile(byte[] outputBytes, String outputFile)

Here you can find the source of writeFile(byte[] outputBytes, String outputFile)

Description

write File

License

Open Source License

Declaration

public static void writeFile(byte[] outputBytes, String outputFile) throws FileNotFoundException, IOException 

Method Source Code

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

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

import java.io.OutputStream;

public class Main {
    public static void writeFile(byte[] outputBytes, String outputFile) throws FileNotFoundException, IOException {

        OutputStream os = new FileOutputStream(outputFile);

        os.write(outputBytes);//from  ww w .  j  ava 2 s. c  om

        os.flush();

        os.close();

    }
}

Related

  1. writeFile(byte[] data, File outFile)
  2. writeFile(byte[] data, String fileName)
  3. writeFile(byte[] data, String filePath)
  4. writeFile(byte[] data, String path, boolean overwrite)
  5. writeFile(byte[] fileData, String path)
  6. writeFile(File f, byte[] data)
  7. writeFile(File file, byte[] b)
  8. writeFile(File file, byte[] content)
  9. writeFile(File file, byte[] context, boolean append)