Class JPEGSegmentUtil
java.lang.Object
com.twelvemonkeys.imageio.metadata.jpeg.JPEGSegmentUtil
JPEGSegmentUtil
- Version:
- $Id: JPEGSegmentUtil.java,v 1.0 24.01.11 17.37 haraldk Exp$
- Author:
- Harald Kuhr, last modified by $Author: haraldk$
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isKnownJPEGMarker
(int marker) static void
static List<JPEGSegment>
readSegments
(ImageInputStream stream, int marker, String identifier) Reads the requested JPEG segments from the stream.static List<JPEGSegment>
readSegments
(ImageInputStream stream, Map<Integer, List<String>> segmentIdentifiers) Reads the requested JPEG segments from the stream.
-
Field Details
-
ALL_IDS
-
ALL_SEGMENTS
-
APP_SEGMENTS
-
-
Method Details
-
readSegments
public static List<JPEGSegment> readSegments(ImageInputStream stream, int marker, String identifier) throws IOException Reads the requested JPEG segments from the stream. The stream position must be directly before the SOI marker, and only segments for the current image is read.- Parameters:
stream
- the stream to read from.marker
- the segment marker to readidentifier
- the identifier to read, ornull
to match any segment- Returns:
- a list of segments with the given app marker and optional identifier. If no segments are found, an empty list is returned.
- Throws:
IIOException
- if a JPEG format exception occurs during readingIOException
- if an I/O exception occurs during reading
-
readSegments
public static List<JPEGSegment> readSegments(ImageInputStream stream, Map<Integer, List<String>> segmentIdentifiers) throws IOExceptionReads the requested JPEG segments from the stream. The stream position must be directly before the SOI marker, and only segments for the current image is read.- Parameters:
stream
- the stream to read from.segmentIdentifiers
- the segment identifiers- Returns:
- a list of segments with the given app markers and optional identifiers. If no segments are found, an empty list is returned.
- Throws:
IIOException
- if a JPEG format exception occurs during readingIOException
- if an I/O exception occurs during reading- See Also:
-
isKnownJPEGMarker
public static boolean isKnownJPEGMarker(int marker) -
main
- Throws:
IOException
-