org.apache.fop.image.analyser
Class JPEGReader

java.lang.Object
  |
  +--org.apache.fop.image.analyser.AbstractImageReader
        |
        +--org.apache.fop.image.analyser.JPEGReader
All Implemented Interfaces:
ImageReader

public class JPEGReader
extends AbstractImageReader

ImageReader object for JPEG image type.

Version:
1.0
Author:
Pankaj Narula

Field Summary
protected static int APP0
           
protected static int APPF
           
protected  byte[] header
           
protected static int JPG_SIG_LENGTH
           
protected static int MARK
          Only SOFn and APPn markers are defined as SOFn is needed for the height and width search.
protected static int NULL
           
protected static int SOF1
           
protected static int SOF2
           
protected static int SOF3
           
protected static int SOFA
           
protected static int SOI
           
protected static int SOS
           
 
Fields inherited from class org.apache.fop.image.analyser.AbstractImageReader
height, imageStream, width
 
Constructor Summary
JPEGReader()
           
 
Method Summary
 java.lang.String getMimeType()
          Return correspondig mime type.
protected  int read2bytes()
           
protected  void setDefaultHeader()
           
protected  void setDimension()
           
protected  long skip(long n)
           
 boolean verifySignature(java.lang.String uri, java.io.BufferedInputStream fis)
          Verify image type.
 
Methods inherited from class org.apache.fop.image.analyser.AbstractImageReader
getHeight, getInputStream, getWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MARK

protected static final int MARK
Only SOFn and APPn markers are defined as SOFn is needed for the height and width search. APPn is also defined because if the JPEG contains thumbnails the dimensions of the thumnail would also be after the SOFn marker enclosed inside the APPn marker. And we don't want to confuse those dimensions with the image dimensions.

NULL

protected static final int NULL

SOF1

protected static final int SOF1

SOF2

protected static final int SOF2

SOF3

protected static final int SOF3

SOFA

protected static final int SOFA

APP0

protected static final int APP0

APPF

protected static final int APPF

SOS

protected static final int SOS

SOI

protected static final int SOI

JPG_SIG_LENGTH

protected static final int JPG_SIG_LENGTH

header

protected byte[] header
Constructor Detail

JPEGReader

public JPEGReader()
Method Detail

verifySignature

public boolean verifySignature(java.lang.String uri,
                               java.io.BufferedInputStream fis)
                        throws java.io.IOException
Description copied from interface: ImageReader
Verify image type.
Overrides:
verifySignature in class AbstractImageReader
Following copied from interface: org.apache.fop.image.analyser.ImageReader
Parameters:
bis - Image buffered input stream
Returns:
true if image type is the handled one
Throws:
java.io.IOException - io error

getMimeType

public java.lang.String getMimeType()
Description copied from interface: ImageReader
Return correspondig mime type.
Overrides:
getMimeType in class AbstractImageReader
Following copied from interface: org.apache.fop.image.analyser.ImageReader
Returns:
image mime type

setDefaultHeader

protected void setDefaultHeader()
                         throws java.io.IOException

setDimension

protected void setDimension()
                     throws java.io.IOException

read2bytes

protected int read2bytes()
                  throws java.io.IOException

skip

protected long skip(long n)
             throws java.io.IOException


Copyright ? 1999-2003 Apache Software Foundation. All Rights Reserved.