Java tutorial
//package com.java2s; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; public class Main { /** * <pre> * Save byte array to arbitrary file. * </pre> * @param in byte array * @param absolutePath absolute path to destination file */ public static void saveFile(byte[] in, String absolutePath) throws IOException { File file = new File(absolutePath); if (!file.exists()) { file.createNewFile(); } FileOutputStream out = new FileOutputStream(absolutePath); out.write(in); out.close(); } }