Package com.drew.imaging.jpeg
Class JpegSegmentReader
- java.lang.Object
 - 
- com.drew.imaging.jpeg.JpegSegmentReader
 
 
- 
public class JpegSegmentReader extends java.lang.ObjectPerforms read functions of JPEG files, returning specific file segments.JPEG files are composed of a sequence of consecutive JPEG 'segments'. Each is identified by one of a set of byte values, modelled in the
JpegSegmentTypeenumeration. UsereadSegmentsto read out the some or all segments into aJpegSegmentDataobject, from which the raw JPEG segment byte arrays may be accessed. 
- 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static JpegSegmentDatareadSegments(SequentialReader reader, java.lang.Iterable<JpegSegmentType> segmentTypes)Processes the provided JPEG data, and extracts the specified JPEG segments into aJpegSegmentDataobject.static JpegSegmentDatareadSegments(java.io.File file, java.lang.Iterable<JpegSegmentType> segmentTypes)Processes the provided JPEG data, and extracts the specified JPEG segments into aJpegSegmentDataobject. 
 - 
 
- 
- 
Method Detail
- 
readSegments
public static JpegSegmentData readSegments(java.io.File file, java.lang.Iterable<JpegSegmentType> segmentTypes) throws JpegProcessingException, java.io.IOException
Processes the provided JPEG data, and extracts the specified JPEG segments into aJpegSegmentDataobject.Will not return SOS (start of scan) or EOI (end of image) segments.
- Parameters:
 file- aFilefrom which the JPEG data will be read.segmentTypes- the set of JPEG segments types that are to be returned. If this argument isnullthen all found segment types are returned.- Throws:
 JpegProcessingExceptionjava.io.IOException
 
- 
readSegments
public static JpegSegmentData readSegments(SequentialReader reader, java.lang.Iterable<JpegSegmentType> segmentTypes) throws JpegProcessingException, java.io.IOException
Processes the provided JPEG data, and extracts the specified JPEG segments into aJpegSegmentDataobject.Will not return SOS (start of scan) or EOI (end of image) segments.
- Parameters:
 reader- aSequentialReaderfrom which the JPEG data will be read. It must be positioned at the beginning of the JPEG data stream.segmentTypes- the set of JPEG segments types that are to be returned. If this argument isnullthen all found segment types are returned.- Throws:
 JpegProcessingExceptionjava.io.IOException
 
 - 
 
 -