com.twelvemonkeys.imageio.metadata.jpeg
Class JPEGSegmentUtil
java.lang.Object
com.twelvemonkeys.imageio.metadata.jpeg.JPEGSegmentUtil
public final class JPEGSegmentUtil
- extends Object
JPEGSegmentUtil
- Version:
- $Id: JPEGSegmentUtil.java,v 1.0 24.01.11 17.37 haraldk Exp$
- Author:
- Harald Kuhr, last modified by $Author: haraldk$
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ALL_IDS
public static final List<String> ALL_IDS
ALL_SEGMENTS
public static final Map<Integer,List<String>> ALL_SEGMENTS
APP_SEGMENTS
public static final Map<Integer,List<String>> APP_SEGMENTS
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, or null 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 reading
IOException - if an I/O exception occurs during reading
readSegments
public static List<JPEGSegment> readSegments(ImageInputStream stream,
Map<Integer,List<String>> segmentIdentifiers)
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.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 reading
IOException - if an I/O exception occurs during reading- See Also:
ALL_SEGMENTS,
APP_SEGMENTS,
ALL_IDS
main
public static void main(String[] args)
throws IOException
- Throws:
IOException
Copyright © 2015. All Rights Reserved.