public static void writeFile ( File file , byte [ ] bytes ) throws IOException { FileOutputStream fos = null ; try { fos = new FileOutputStream ( file ) ; fos . write ( bytes ) ; } finally { if ( fos != null ) { fos . close ( ) ; } } }
Write bytes to the given file .