Here you can find the source of writeFileFromBytes(byte[] bytes, File file)
public static void writeFileFromBytes(byte[] bytes, File file) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { public static void writeFileFromBytes(byte[] bytes, File file) throws IOException { OutputStream os = new FileOutputStream(file); // Get the size of the file long length = bytes.length; // Write the file os.write(bytes);//from w w w.ja v a 2 s. c om // Close the input stream and return bytes os.close(); return; } }