Class JPEGFile
- java.lang.Object
-
- org.apache.xmlgraphics.image.loader.impl.JPEGFile
-
- All Implemented Interfaces:
JPEGConstants
public class JPEGFile extends Object implements JPEGConstants
Provides methods useful for processing JPEG files.
-
-
Constructor Summary
Constructors Constructor Description JPEGFile(InputStream in)Constructor for InputStreams.JPEGFile(ImageInputStream in)Constructor for ImageInputStreams.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataInputgetDataInput()Returns theDataInputinstance this object operates on.intreadMarkerSegment()Reads the next marker segment identifier and returns it.intreadSegmentLength()Reads the segment length of the current marker segment and returns it.voidskipCurrentMarkerSegment()Skips the current marker segment.
-
-
-
Constructor Detail
-
JPEGFile
public JPEGFile(ImageInputStream in)
Constructor for ImageInputStreams.- Parameters:
in- the input stream to read the image from
-
JPEGFile
public JPEGFile(InputStream in)
Constructor for InputStreams.- Parameters:
in- the input stream to read the image from
-
-
Method Detail
-
getDataInput
public DataInput getDataInput()
Returns theDataInputinstance this object operates on.- Returns:
- the data input instance
-
readMarkerSegment
public int readMarkerSegment() throws IOExceptionReads the next marker segment identifier and returns it.- Returns:
- the marker segment identifier
- Throws:
IOException- if an I/O error occurs while reading from the image file
-
readSegmentLength
public int readSegmentLength() throws IOExceptionReads 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:
IOException- if an I/O error occurs while reading from the image file
-
skipCurrentMarkerSegment
public void skipCurrentMarkerSegment() throws IOExceptionSkips the current marker segment. The method assumes the file cursor is right after the segment header.- Throws:
IOException- if an I/O error occurs while reading from the image file
-
-