info.magnolia.imaging
Class DefaultImageStreamer<P>

java.lang.Object
  extended by info.magnolia.imaging.DefaultImageStreamer<P>
Type Parameters:
P - type of ParameterProvider's parameter
All Implemented Interfaces:
ImageStreamer<P>

public class DefaultImageStreamer<P>
extends Object
implements ImageStreamer<P>

An ImageStreamer implementation which always generates the image. It also knows about some of the javax.imageio quirks, so other implementations should consider subclassing or wrapping it.

Version:
$Id$

Constructor Summary
DefaultImageStreamer()
           
 
Method Summary
 void serveImage(ImageGenerator<ParameterProvider<P>> generator, ParameterProvider<P> params, OutputStream out)
          Generates an image (if deemed necessary) with the given ImageGenerator and Parameters, streams it to the given OutputStream.
protected  void write(BufferedImage img, OutputStream out, OutputFormat outputFormat)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultImageStreamer

public DefaultImageStreamer()
Method Detail

serveImage

public void serveImage(ImageGenerator<ParameterProvider<P>> generator,
                       ParameterProvider<P> params,
                       OutputStream out)
                throws ImagingException,
                       IOException
Description copied from interface: ImageStreamer
Generates an image (if deemed necessary) with the given ImageGenerator and Parameters, streams it to the given OutputStream.

Specified by:
serveImage in interface ImageStreamer<P>
Throws:
ImagingException
IOException

write

protected void write(BufferedImage img,
                     OutputStream out,
                     OutputFormat outputFormat)
              throws IOException
Throws:
IOException


Copyright © 2013 Magnolia International Ltd.. All Rights Reserved.