com.twelvemonkeys.imageio.metadata.jpeg
Class JPEGSegmentUtil

java.lang.Object
  extended by 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$

Field Summary
static List<String> ALL_IDS
           
static Map<Integer,List<String>> ALL_SEGMENTS
           
static Map<Integer,List<String>> APP_SEGMENTS
           
 
Method Summary
static void main(String[] args)
           
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Method Detail

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 read
identifier - 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.