public static void write(byte[] data, File file) {
        OutputStream os = null;
        try {
            os = new FileOutputStream(file);
            os.write(data);
            os.flush();
        } catch (IOException e) {
            throw new UnexpectedException(e);
        } finally {
            try {
                if (os != null) os.close();
            } catch (Exception e) {
                //
            }
        }
    }
public static void write ( byte [ ] data , File file ) { OutputStream os = null ; try { os = new FileOutputStream ( file ) ; os . write ( data ) ; os . flush ( ) ; } catch ( IOException e ) { throw new UnexpectedException ( e ) ; } finally { try { if ( os != null ) os . close ( ) ; } catch ( Exception e ) { } } }
Write binay data to a file

@param data The binary data to write
@param file The file to write