com.drew.imaging.jpeg
public class JpegSegmentReader extends Object
Field Summary | |
---|---|
static byte | SEGMENT_APP0 APP0 Jpeg segment identifier -- Jfif data. |
static byte | SEGMENT_APP1 APP1 Jpeg segment identifier -- where Exif data is kept. |
static byte | SEGMENT_APP2 APP2 Jpeg segment identifier. |
static byte | SEGMENT_APP3 APP3 Jpeg segment identifier. |
static byte | SEGMENT_APP4 APP4 Jpeg segment identifier. |
static byte | SEGMENT_APP5 APP5 Jpeg segment identifier. |
static byte | SEGMENT_APP6 APP6 Jpeg segment identifier. |
static byte | SEGMENT_APP7 APP7 Jpeg segment identifier. |
static byte | SEGMENT_APP8 APP8 Jpeg segment identifier. |
static byte | SEGMENT_APP9 APP9 Jpeg segment identifier. |
static byte | SEGMENT_APPA APPA Jpeg segment identifier -- can hold Unicode comments. |
static byte | SEGMENT_APPB APPB Jpeg segment identifier. |
static byte | SEGMENT_APPC APPC Jpeg segment identifier. |
static byte | SEGMENT_APPD APPD Jpeg segment identifier -- IPTC data in here. |
static byte | SEGMENT_APPE APPE Jpeg segment identifier. |
static byte | SEGMENT_APPF APPF Jpeg segment identifier. |
static byte | SEGMENT_COM Jpeg comment segment identifier. |
static byte | SEGMENT_DHT Define Huffman Table segment identifier. |
static byte | SEGMENT_DQT Define Quantization Table segment identifier. |
static byte | SEGMENT_SOF0 Start-of-Frame Zero segment identifier. |
static byte | SEGMENT_SOI Start Of Image segment identifier. |
Constructor Summary | |
---|---|
JpegSegmentReader(File file)
Creates a JpegSegmentReader for a specific file. | |
JpegSegmentReader(byte[] fileContents)
Creates a JpegSegmentReader for a byte array. | |
JpegSegmentReader(InputStream in) | |
JpegSegmentReader(JpegSegmentData segmentData) |
Method Summary | |
---|---|
int | getSegmentCount(byte segmentMarker) |
JpegSegmentData | getSegmentData() |
byte[] | readSegment(byte segmentMarker)
Reads the first instance of a given Jpeg segment, returning the contents as
a byte array. |
byte[] | readSegment(byte segmentMarker, int occurrence)
Reads the first instance of a given Jpeg segment, returning the contents as
a byte array. |
Parameters: file the Jpeg file to read segments from
Parameters: fileContents the byte array containing Jpeg data
Parameters: segmentMarker the byte identifier for the desired segment
Returns: the byte array if found, else null
Throws: JpegProcessingException for any problems processing the Jpeg data, including inner IOExceptions
Parameters: segmentMarker the byte identifier for the desired segment occurrence the occurrence of the specified segment within the jpeg file
Returns: the byte array if found, else null