xmlgraphics-commons 1.3.1

org.apache.xmlgraphics.image.loader.impl
Class JPEGFile

java.lang.Object
  extended by org.apache.xmlgraphics.image.loader.impl.JPEGFile
All Implemented Interfaces:
JPEGConstants

public class JPEGFile
extends java.lang.Object
implements JPEGConstants

Provides methods useful for processing JPEG files.


Field Summary
protected static org.apache.commons.logging.Log log
          logger
 
Fields inherited from interface org.apache.xmlgraphics.image.loader.impl.JPEGConstants
APP0, APP1, APP2, APPD, APPE, APPF, EOI, MARK, NULL, SOF0, SOF1, SOF2, SOFA, SOI, SOS
 
Constructor Summary
JPEGFile(javax.imageio.stream.ImageInputStream in)
          Constructor for ImageInputStreams.
JPEGFile(java.io.InputStream in)
          Constructor for InputStreams.
 
Method Summary
 java.io.DataInput getDataInput()
          Returns the DataInput instance this object operates on.
 int readMarkerSegment()
          Reads the next marker segment identifier and returns it.
 int readSegmentLength()
          Reads the segment length of the current marker segment and returns it.
 void skipCurrentMarkerSegment()
          Skips the current marker segment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
logger

Constructor Detail

JPEGFile

public JPEGFile(javax.imageio.stream.ImageInputStream in)
Constructor for ImageInputStreams.

Parameters:
in - the input stream to read the image from

JPEGFile

public JPEGFile(java.io.InputStream in)
Constructor for InputStreams.

Parameters:
in - the input stream to read the image from
Method Detail

getDataInput

public java.io.DataInput getDataInput()
Returns the DataInput instance this object operates on.

Returns:
the data input instance

readMarkerSegment

public int readMarkerSegment()
                      throws java.io.IOException
Reads the next marker segment identifier and returns it.

Returns:
the marker segment identifier
Throws:
java.io.IOException - if an I/O error occurs while reading from the image file or if the stream is not positioned at a marker segment header

readSegmentLength

public int readSegmentLength()
                      throws java.io.IOException
Reads the segment length of the current marker segment and returns it. The method assumes the file cursor is right after the segment header.

Returns:
the segment length
Throws:
java.io.IOException

skipCurrentMarkerSegment

public void skipCurrentMarkerSegment()
                              throws java.io.IOException
Skips the current marker segment. The method assumes the file cursor is right after the segment header.

Throws:
java.io.IOException - if an I/O error occurs while reading from the image file

xmlgraphics-commons 1.3.1

Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.