Here you can find the source of saveData(byte[] data, String PATH, String fileName)
public static boolean saveData(byte[] data, String PATH, String fileName)
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.FileOutputStream; public class Main { public static boolean saveData(byte[] data, String PATH, String fileName) { boolean ok = false; if (data != null) { try { FileOutputStream fos; File outputDir = new File(PATH); File saveFile = new File(outputDir, fileName); fos = new FileOutputStream(saveFile); fos.write(data);// www . ja v a 2 s.c o m fos.flush(); fos.close(); ok = true; } catch (Exception e) { e.printStackTrace(); } } return ok; } }