Here you can find the source of writeFile(byte[] b, String fileName)
public static void writeFile(byte[] b, String fileName)
//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(); } } }