Java tutorial
//package com.java2s; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; public class Main { private static String PICTURE_TEMP_PATH; public static void savePicture(byte[] picture) throws IOException { OutputStream out = null; try { out = new FileOutputStream(PICTURE_TEMP_PATH); out.write(picture); out.flush(); } finally { if (out != null) { out.close(); } } } }