/** * Transforms the rendered image into the appropriate format, streaming to the output stream. * * @see RasterMapOutputFormat#formatImageOutputStream(RenderedImage, OutputStream) */ @Override public void formatImageOutputStream( RenderedImage image, OutputStream outStream, WMSMapContent mapContent) throws ServiceException, IOException { JpegOrPngChooser chooser = JpegOrPngChooser.getFromMapContent(image, mapContent); if (chooser.isJpegPreferred()) { jpegResponse.formatImageOutputStream(image, outStream, mapContent); } else { pngResponse.formatImageOutputStream(image, outStream, mapContent); } }