Here you can find the source of saveDataToFile(String filePath, byte[] data)
@SuppressWarnings("resource") public static boolean saveDataToFile(String filePath, byte[] data)
//package com.java2s; import java.io.FileOutputStream; import java.io.IOException; public class Main { @SuppressWarnings("resource") public static boolean saveDataToFile(String filePath, byte[] data) { FileOutputStream f = null; try {// w w w . ja v a 2 s . c om f = new FileOutputStream(filePath); f.write(data); } catch (IOException e) { return false; } return true; } }