public static void storeByteArrayToFile ( final byte [ ] data , final File file ) throws IOException { try ( FileOutputStream fos = new FileOutputStream ( file ) ; BufferedOutputStream bos = new BufferedOutputStream ( fos ) ; ) { bos . write ( data ) ; bos . flush ( ) ; } }
Saves a byte array to the given file .