Java Write Byte Array to File writeFile(byte[] b, String fileName)

Here you can find the source of writeFile(byte[] b, String fileName)

Description

write File

License

Open Source License

Declaration

public static void writeFile(byte[] b, String fileName) 

Method Source Code

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

import java.io.DataOutputStream;

import java.io.FileOutputStream;

public class Main {
    public static void writeFile(byte[] b, String fileName) {
        try {//from   w w  w .j a v  a 2s  .  com
            DataOutputStream out = new DataOutputStream(new FileOutputStream(fileName));
            out.write(b);
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

Related

  1. writeFile(byte data[], File file)
  2. writeFile(byte[] buf, File file)
  3. writeFile(byte[] bytes, File file)
  4. writeFile(byte[] bytes, File file)
  5. writeFile(byte[] bytes, File file)