KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > media > format > image > iio > JPEGMediaFormat


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license. See terms of license at gnu.org.
5  */

6
7 package org.jboss.media.format.image.iio;
8
9 import java.io.InputStream JavaDoc;
10
11 import javax.emb.MediaException;
12 import javax.emb.MediaHeader;
13 import javax.imageio.ImageReader JavaDoc;
14 import javax.imageio.metadata.IIOMetadata JavaDoc;
15
16 /**
17  * JPEG <code>MediaFormat</code> based on the Java Image I/O API.
18  *
19  * @version <tt>$Revision: 1.2 $</tt>
20  * @author <a HREF="mailto:ricardoarguello@users.sourceforge.net">Ricardo
21  * Argüello</a>
22  */

23 public class JPEGMediaFormat extends IIOMediaFormat
24 {
25    // FIXME
26
private static final long serialVersionUID = 0L;
27
28    /**
29     * Constructor.
30     *
31     * @param imageReader
32     */

33    public JPEGMediaFormat(ImageReader JavaDoc imageReader)
34    {
35       super(imageReader);
36    }
37
38    /**
39     * @see javax.emb.MediaFormat#extractHeader(javax.emb.Media)
40     */

41    public MediaHeader extractHeader(InputStream JavaDoc content) throws MediaException
42    {
43       IIOMetadata JavaDoc imageMetadata = extractImageMetadata(content);
44       return new JPEGMediaHeader(imageMetadata);
45    }
46 }
Popular Tags