package org.artgasmator.utils;

import java.io.IOException;

import javax.servlet.http.HttpServletResponse;

public class IOUtils {

	public static void writeImageByteArrayToStream(HttpServletResponse response, 
			byte[] array) 
			throws IOException {
		response.setContentType("image/jpeg");
		response.setContentLength(array.length);
		response.getOutputStream().write(array); 
		response.getOutputStream().flush();
		response.getOutputStream().close();
	}
}
