org.jboss.media.format.image.iio
Class IIOMediaFormat

java.lang.Object
  extended byorg.jboss.media.format.EmbeddedMediaFormat (src) 
      extended byorg.jboss.media.format.image.iio.IIOMediaFormat
All Implemented Interfaces:
MediaFormat (src) , java.io.Serializable
Direct Known Subclasses:
JPEGMediaFormat (src) , PNGMediaFormat (src) , StandardMediaFormat (src)

public abstract class IIOMediaFormat
extends EmbeddedMediaFormat (src)

Implementation of the MediaFormat interface based on the Java Image I/O API to be used on embedded media.

See Also:
Serialized Form

Field Summary
protected  javax.imageio.ImageReader imageReader
           
 
Constructor Summary
IIOMediaFormat(javax.imageio.ImageReader imageReader)
          Constructor.
 
Method Summary
abstract  MediaHeader (src) extractHeader(java.io.InputStream content)
          Extracts a media header instance from the given media content and returns it.
protected  javax.imageio.metadata.IIOMetadata extractImageMetadata(java.io.InputStream content)
           
 java.lang.String getDefaultMimeType()
          Returns the default MIME type for the given media format as a String.
 boolean isStreamingDesirable()
          Returns true if it is always desirable to stream media of this format, or false otherwise.
 
Methods inherited from class org.jboss.media.format.EmbeddedMediaFormat (src)
assembleContent, disassembleContent, extractProxy, isEmbedded
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

imageReader

protected javax.imageio.ImageReader imageReader
Constructor Detail

IIOMediaFormat

public IIOMediaFormat(javax.imageio.ImageReader imageReader)
Constructor.

Parameters:
imageReader -
Method Detail

extractHeader

public abstract MediaHeader (src)  extractHeader(java.io.InputStream content)
                                   throws MediaException (src) 
Description copied from interface: MediaFormat (src)
Extracts a media header instance from the given media content and returns it. The information presented by the header is up to the implementation of the media format bean, and the information returned can therefore be the complete header information as defined in the relevant media format standard, no information at all, or something in between. However, implementers are encouraged to return header information as complete as possible, as such information can be highly useful for format specific algorithms and optimizations.

Please note that the given input stream is not closed once the operation is successfully completed.

Specified by:
extractHeader in interface MediaFormat (src)
Specified by:
extractHeader in class EmbeddedMediaFormat (src)
Throws:
MediaException (src)
See Also:
javax.emb.MediaFormat#extractHeader(javax.emb.Media)

getDefaultMimeType

public java.lang.String getDefaultMimeType()
Description copied from interface: MediaFormat (src)
Returns the default MIME type for the given media format as a String. If there is no suitable MIME type, Media.MIME_TYPE_UNKNOWN should be returned.

Specified by:
getDefaultMimeType in interface MediaFormat (src)
Specified by:
getDefaultMimeType in class EmbeddedMediaFormat (src)
See Also:
MediaFormat.getDefaultMimeType()

isStreamingDesirable

public boolean isStreamingDesirable()
Description copied from interface: MediaFormat (src)
Returns true if it is always desirable to stream media of this format, or false otherwise. For example, it is not always desirable to stream JPEG or GIF images, even given the possibility to stream them with a Real player. Servlets can use this information to decide whether they should try to stream content or transfer it using burst transfer instead.

Specified by:
isStreamingDesirable in interface MediaFormat (src)
Specified by:
isStreamingDesirable in class EmbeddedMediaFormat (src)
See Also:
MediaFormat.isStreamingDesirable()

extractImageMetadata

protected javax.imageio.metadata.IIOMetadata extractImageMetadata(java.io.InputStream content)
                                                           throws MediaException (src) 
Throws:
MediaException (src)