Here you can find the source of saveArray(byte[] pictureBytes, OutputStream stream)
public static void saveArray(byte[] pictureBytes, OutputStream stream)
//package com.java2s; //License from project: LGPL import java.io.Closeable; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; public class Main { public static void saveArray(byte[] pictureBytes, OutputStream stream) { try {//w w w . jav a 2s . c om stream.write(pictureBytes); } catch (IOException e) { } } public static void saveArray(byte[] pictureBytes, File output) { FileOutputStream stream; try { stream = new FileOutputStream(output); try { saveArray(pictureBytes, stream); } finally { closeStream((Closeable) stream); } } catch (FileNotFoundException e1) { } } public static void closeStream(Closeable stream) { if (stream != null) { try { stream.close(); } catch (IOException e) { } } } }