Here you can find the source of writeFile(String filename, byte file[])
public static void writeFile(String filename, byte file[]) throws Exception
//package com.java2s; //License from project: Open Source License import java.nio.file.*; public class Main { public static void writeFile(String filename, byte file[]) throws Exception { java.nio.file.Path p = Paths.get(filename, new String[0]); Files.write(p, file, new OpenOption[] { StandardOpenOption.CREATE }); }/* ww w . j a v a2 s . c o m*/ }