code: public static void saveBytesToFile(byte[] data, File file) {
  		if (data == null) {
  			return;
  		}
  		FileOutputStream fos = null;
  		BufferedOutputStream bos = null;
  		try {
  			fos = new FileOutputStream(file);
  			bos = new BufferedOutputStream(fos);
  			bos.write(data);
  			bos.flush();
  		} catch (FileNotFoundException e) {
  			e.printStackTrace();
  		} catch (IOException e) {
  			e.printStackTrace();
  		} finally {
  			if (bos != null) {
  				try {
  					bos.close();
  				} catch (IOException e) {
  					e.printStackTrace();
  				}
  			}
  			if (fos != null) {
  				try {
  					fos.close();
  				} catch (IOException e) {
  					e.printStackTrace();
  				}
  			}
  		}
  	}
docs: save to file
  
  @param data
  @param file