nextapp.echo
Class StreamImageReference

java.lang.Object
  extended by nextapp.echo.AbstractImageReference
      extended by nextapp.echo.StreamImageReference
All Implemented Interfaces:
java.io.Serializable, ImageReference
Direct Known Subclasses:
EncodedImageReference, URLImageReference

public abstract class StreamImageReference
extends AbstractImageReference
implements java.io.Serializable

A reference to an image that will be retrieved from a binary stream.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class nextapp.echo.AbstractImageReference
listenerList
 
Fields inherited from interface nextapp.echo.ImageReference
SIZE_UNKNOWN
 
Constructor Summary
StreamImageReference()
          Default constructor.
 
Method Summary
abstract  java.lang.String getContentType()
          Returns the valid RFC 1521 image content type (image/png, image/jpeg, image/gif, etc) of the image.
 int getHeight()
          Returns the height of the image.
 int getWidth()
          Returns the width of the image.
abstract  void render(java.io.OutputStream out)
          Sends a byte representation of the image in its native format out the given output stream.
 
Methods inherited from class nextapp.echo.AbstractImageReference
addImageUpdateListener, removeImageUpdateListener, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamImageReference

public StreamImageReference()
Default constructor.

Method Detail

getContentType

public abstract java.lang.String getContentType()
Returns the valid RFC 1521 image content type (image/png, image/jpeg, image/gif, etc) of the image.

Returns:
The content type of the image.

getHeight

public int getHeight()
Description copied from interface: ImageReference
Returns the height of the image. If the height is not known, SIZE_UNKNOWN should be returned.

Specified by:
getHeight in interface ImageReference
Returns:
The height of the image in pixels.
See Also:
ImageReference.getHeight()

getWidth

public int getWidth()
Description copied from interface: ImageReference
Returns the width of the image. If the width is not known, SIZE_UNKNOWN should be returned.

Specified by:
getWidth in interface ImageReference
Returns:
The width of the image in pixels.
See Also:
ImageReference.getWidth()

render

public abstract void render(java.io.OutputStream out)
                     throws java.io.IOException
Sends a byte representation of the image in its native format out the given output stream.

Parameters:
out - The output stream to write the image.
Throws:
java.io.IOException