* the response
*/
private HttpResponse updateResponse(HttpResponse response, BufferedImage image)
throws IOException {
ImageWriter imageWriter = ImageIO.getImageWritersByFormatName(RESIZE_OUTPUT_FORMAT).next();
ImageOutputter outputter = new ImageIOOutputter(imageWriter, null);
byte[] imageBytes = outputter.toBytes(image);
HttpResponseBuilder newResponseBuilder = new HttpResponseBuilder(response)
.setResponse(imageBytes)
.setHeader(CONTENT_TYPE, CONTENT_TYPE_IMAGE_PNG)
.setHeader(CONTENT_LENGTH, String.valueOf(imageBytes.length));
return newResponseBuilder.create();