new JpegCommentReader().extract(new ByteArrayReader(comSegment), metadata);
// Loop through all APP0 segments, looking for a JFIF segment.
for (byte[] app0Segment : segmentReader.getSegments(JpegSegmentReader.SEGMENT_APP0)) {
if (app0Segment.length > 3 && new String(app0Segment, 0, 4).equals("JFIF"))
new JfifReader().extract(new ByteArrayReader(app0Segment), metadata);
}
// Loop through all APP1 segments, checking the leading bytes to identify the format of each.
for (byte[] app1Segment : segmentReader.getSegments(JpegSegmentReader.SEGMENT_APP1)) {
if (app1Segment.length > 3 && "EXIF".equalsIgnoreCase(new String(app1Segment, 0, 4)))