Java tutorial
//package com.java2s; import java.io.File; import java.io.FileOutputStream; public class Main { public static void saveImage(File file, byte[] bytes) throws Exception { file.delete(); FileOutputStream fos = new FileOutputStream(file); fos.write(bytes); fos.flush(); fos.close(); } }