APIdia Launch Partner
Top Fields Constructors Methods
com.sun.imageio.plugins.tiff

public Class TIFFImageReader

extends ImageReader
Class Inheritance
Imports
java.awt.Point, .Rectangle, java.awt.color.ColorSpace, .ICC_ColorSpace, .ICC_Profile, java.awt.image.BufferedImage, .ColorModel, .ComponentColorModel, .Raster, .RenderedImage, .SampleModel, java.io.EOFException, .IOException, java.nio.ByteOrder, java.util.ArrayList, .HashMap, .Iterator, .List, javax.imageio.IIOException, .ImageIO, .ImageReader, .ImageReadParam, .ImageTypeSpecifier, javax.imageio.metadata.IIOMetadata, javax.imageio.spi.ImageReaderSpi, javax.imageio.stream.ImageInputStream, org.w3c.dom.Node, com.sun.imageio.plugins.common.ImageUtil, javax.imageio.plugins.tiff.BaselineTIFFTagSet, .TIFFField, .TIFFImageReadParam, .TIFFTagSet

Field Summary

Modifier and TypeField and Description
private static final int
private int[]
private char[]
private int
private int
private TIFFDecompressor
private int[]
private int
private int
private int
private int
private int
private int
private int[]
private boolean
private int
private TIFFImageMetadata
private ImageReadParam
private List<Long>
private HashMap<Integer, List<ImageTypeSpecifier>>
private int
private int
private int
private int
private int
private int
private int[]
private static final int
private int
private int[]
private int
private int
private int
private int
private ImageInputStream
private TIFFStreamMetadata
private BufferedImage
private int
private int
private int
private int
private int
Inherited from javax.imageio.ImageReader:
availableLocalesignoreMetadatainputlocaleminIndexoriginatingProviderprogressListenersseekForwardOnlyupdateListenerswarningListenerswarningLocales

Constructor Summary

AccessConstructor and Description
public
TIFFImageReader(ImageReaderSpi originatingProvider)

Method Summary

Modifier and TypeMethod and Description
public boolean
canReadRaster()

Overrides javax.imageio.ImageReader.canReadRaster.

Returns true if this plug-in supports reading just a Raster of pixel data.

private void
checkIndex(int imageIndex)

private void
decodeTile(int ti, int tj, int band)

pack-priv void
forwardWarningMessage(String warning)

Package scope method to allow decompressors, for example, to emit warning messages.

private int
public ImageReadParam
getDefaultReadParam()

Overrides javax.imageio.ImageReader.getDefaultReadParam.

Returns a default ImageReadParam object appropriate for this format.

private int
public int
getHeight(int imageIndex)

Implements abstract javax.imageio.ImageReader.getHeight.

Returns the height in pixels of the given image within the input source.

public IIOMetadata
getImageMetadata(int imageIndex)

Implements abstract javax.imageio.ImageReader.getImageMetadata.

Returns an IIOMetadata object containing metadata associated with the given image, or null if the reader does not support reading metadata, is set to ignore metadata, or if no metadata is available.

public Iterator<ImageTypeSpecifier>
getImageTypes(int imageIndex)

Implements abstract javax.imageio.ImageReader.getImageTypes.

Returns an Iterator containing possible image types to which the given image may be decoded, in the form of ImageTypeSpecifierss.

public int
getNumImages(boolean allowSearch)

Implements abstract javax.imageio.ImageReader.getNumImages.

Returns the number of images, not including thumbnails, available from the current input source.

public int
getNumThumbnails(int imageIndex)

Overrides javax.imageio.ImageReader.getNumThumbnails.

Returns the number of thumbnail preview images associated with the given image.

private int
public IIOMetadata
getStreamMetadata()

Implements abstract javax.imageio.ImageReader.getStreamMetadata.

Returns an IIOMetadata object representing the metadata associated with the input source as a whole (i.e., not associated with any particular image), or null if the reader does not support reading metadata, is set to ignore metadata, or if no metadata is available.

public IIOMetadata
getStreamMetadata(int imageIndex)

public int
getTileHeight(int imageIndex)

Overrides javax.imageio.ImageReader.getTileHeight.

Returns the height of a tile in the given image.

private long
getTileOrStripByteCount(int tileIndex)

private int
private long
getTileOrStripOffset(int tileIndex)

private int
public int
getTileWidth(int imageIndex)

Overrides javax.imageio.ImageReader.getTileWidth.

Returns the width of a tile in the given image.

private int
public int
getWidth(int imageIndex)

Implements abstract javax.imageio.ImageReader.getWidth.

Returns the width in pixels of the given image within the input source.

public boolean
hasThumbnails(int imageIndex)

Overrides javax.imageio.ImageReader.hasThumbnails.

Returns true if the given image has thumbnail preview images associated with it.

private static int
iceil(int num, int den)

private static int
ifloor(int num, int den)

private void
initializeFromMetadata()

Initializes these instance variables from the image metadata:

compression
width
height
samplesPerPixel
numBands
colorMap
photometricInterpretation
sampleFormat
bitsPerSample
extraSamples
tileOrStripWidth
tileOrStripHeight
public boolean
isImageTiled(int imageIndex)

Overrides javax.imageio.ImageReader.isImageTiled.

Returns true if the image is organized into tiles, that is, equal-sized non-overlapping rectangles.

public boolean
isRandomAccessEasy(int imageIndex)

Overrides javax.imageio.ImageReader.isRandomAccessEasy.

Returns true if the storage format of the given image places no inherent impediment on random access to pixels.

private int
locateImage(int imageIndex)

private void
prepareRead(int imageIndex, ImageReadParam param)

public BufferedImage
read(int imageIndex, ImageReadParam param)

Implements abstract javax.imageio.ImageReader.read.

Reads the image indexed by imageIndex and returns it as a complete BufferedImage, using a supplied ImageReadParam.

public RenderedImage
readAsRenderedImage(int imageIndex, ImageReadParam param)

Overrides javax.imageio.ImageReader.readAsRenderedImage.

Returns a RenderedImage object that contains the contents of the image indexed by imageIndex.

private void
private void
public Raster
readRaster(int imageIndex, ImageReadParam param)

Overrides javax.imageio.ImageReader.readRaster.

Returns a new Raster object containing the raw pixel data from the image stream, without any color conversion applied.

public boolean
public BufferedImage
readTile(int imageIndex, int tileX, int tileY)

Overrides javax.imageio.ImageReader.readTile.

Reads the tile indicated by the tileX and tileY arguments, returning it as a BufferedImage.

private void
public void
reset()

Overrides javax.imageio.ImageReader.reset.

Restores the ImageReader to its initial state.

protected void
private void
seekToImage(int imageIndex)

public void
setInput(Object input, boolean seekForwardOnly, boolean ignoreMetadata)

Overrides javax.imageio.ImageReader.setInput.

Sets the input source to use to the given ImageInputStream or other Object.

Inherited from javax.imageio.ImageReader:
abortabortRequestedaddIIOReadProgressListeneraddIIOReadUpdateListeneraddIIOReadWarningListenercheckReadParamBandSettingsclearAbortRequestcomputeRegionsdisposegetAspectRatiogetAvailableLocalesgetDestinationgetFormatNamegetImageMetadatagetInputgetLocalegetMinIndexgetOriginatingProvidergetRawImageTypegetSourceRegiongetStreamMetadatagetThumbnailHeightgetThumbnailWidthgetTileGridXOffsetgetTileGridYOffsetisIgnoringMetadataisSeekForwardOnlyprocessImageCompleteprocessImageProgressprocessImageStartedprocessImageUpdateprocessPassCompleteprocessPassStartedprocessReadAbortedprocessSequenceCompleteprocessSequenceStartedprocessThumbnailCompleteprocessThumbnailPassCompleteprocessThumbnailPassStartedprocessThumbnailProgressprocessThumbnailStartedprocessThumbnailUpdateprocessWarningOccurredprocessWarningOccurredreadreadAllreadAllreaderSupportsThumbnailsreadThumbnailreadTileRasterremoveAllIIOReadProgressListenersremoveAllIIOReadUpdateListenersremoveAllIIOReadWarningListenersremoveIIOReadProgressListenerremoveIIOReadUpdateListenerremoveIIOReadWarningListenersetInputsetInputsetLocale

Field Detail

BITS_PER_SAMPLE_MAXback to summary
private static final int BITS_PER_SAMPLE_MAX
bitsPerSampleback to summary
private int[] bitsPerSample
colorMapback to summary
private char[] colorMap
compressionback to summary
private int compression
currIndexback to summary
private int currIndex
decompressorback to summary
private TIFFDecompressor decompressor
destinationBandsback to summary
private int[] destinationBands
dstHeightback to summary
private int dstHeight
dstMinXback to summary
private int dstMinX
dstMinYback to summary
private int dstMinY
dstWidthback to summary
private int dstWidth
dstXOffsetback to summary
private int dstXOffset
dstYOffsetback to summary
private int dstYOffset
extraSamplesback to summary
private int[] extraSamples
gotHeaderback to summary
private boolean gotHeader
heightback to summary
private int height
imageMetadataback to summary
private TIFFImageMetadata imageMetadata
imageReadParamback to summary
private ImageReadParam imageReadParam
imageStartPositionback to summary
private List<Long> imageStartPosition
imageTypeMapback to summary
private HashMap<Integer, List<ImageTypeSpecifier>> imageTypeMap
numBandsback to summary
private int numBands
numImagesback to summary
private int numImages
photometricInterpretationback to summary
private int photometricInterpretation
pixelsReadback to summary
private int pixelsRead
pixelsToReadback to summary
private int pixelsToRead
planarConfigurationback to summary
private int planarConfiguration
sampleFormatback to summary
private int[] sampleFormat
SAMPLES_PER_PIXEL_MAXback to summary
private static final int SAMPLES_PER_PIXEL_MAX
samplesPerPixelback to summary
private int samplesPerPixel
sourceBandsback to summary
private int[] sourceBands
sourceXOffsetback to summary
private int sourceXOffset
sourceYOffsetback to summary
private int sourceYOffset
srcXSubsamplingback to summary
private int srcXSubsampling
srcYSubsamplingback to summary
private int srcYSubsampling
streamback to summary
private ImageInputStream stream
streamMetadataback to summary
private TIFFStreamMetadata streamMetadata
theImageback to summary
private BufferedImage theImage
tileOrStripHeightback to summary
private int tileOrStripHeight
tileOrStripWidthback to summary
private int tileOrStripWidth
tilesAcrossback to summary
private int tilesAcross
tilesDownback to summary
private int tilesDown
widthback to summary
private int width

Constructor Detail

TIFFImageReaderback to summary
public TIFFImageReader(ImageReaderSpi originatingProvider)

Method Detail

canReadRasterback to summary
public boolean canReadRaster()

Overrides javax.imageio.ImageReader.canReadRaster.

Doc from javax.imageio.ImageReader.canReadRaster.

Returns true if this plug-in supports reading just a Raster of pixel data. If this method returns false, calls to readRaster or readTileRaster will throw an UnsupportedOperationException.

The default implementation returns false.

Annotations
@Override
checkIndexback to summary
private void checkIndex(int imageIndex)
decodeTileback to summary
private void decodeTile(int ti, int tj, int band) throws IOException
forwardWarningMessageback to summary
pack-priv void forwardWarningMessage(String warning)

Package scope method to allow decompressors, for example, to emit warning messages.

getCompressionback to summary
private int getCompression()
getDefaultReadParamback to summary
public ImageReadParam getDefaultReadParam()

Overrides javax.imageio.ImageReader.getDefaultReadParam.

Doc from javax.imageio.ImageReader.getDefaultReadParam.

Returns a default ImageReadParam object appropriate for this format. All subclasses should define a set of default values for all parameters and return them with this call. This method may be called before the input source is set.

The default implementation constructs and returns a new ImageReadParam object that does not allow source scaling (i.e., it returns new ImageReadParam().

Annotations
@Override
getHeightback to summary
private int getHeight()
getHeightback to summary
public int getHeight(int imageIndex) throws IOException

Implements abstract javax.imageio.ImageReader.getHeight.

Doc from javax.imageio.ImageReader.getHeight.

Returns the height in pixels of the given image within the input source.

If the image can be rendered to a user-specified size, then this method returns the default height.

Annotations
@Override
Exceptions
IOException:
if an error occurs reading the height information from the input source.
getImageMetadataback to summary
public IIOMetadata getImageMetadata(int imageIndex) throws IIOException

Implements abstract javax.imageio.ImageReader.getImageMetadata.

Doc from javax.imageio.ImageReader.getImageMetadata.

Returns an IIOMetadata object containing metadata associated with the given image, or null if the reader does not support reading metadata, is set to ignore metadata, or if no metadata is available.

Annotations
@Override
getImageTypesback to summary
public Iterator<ImageTypeSpecifier> getImageTypes(int imageIndex) throws IIOException

Implements abstract javax.imageio.ImageReader.getImageTypes.

Doc from javax.imageio.ImageReader.getImageTypes.

Returns an Iterator containing possible image types to which the given image may be decoded, in the form of ImageTypeSpecifierss. At least one legal image type will be returned.

The first element of the iterator should be the most "natural" type for decoding the image with as little loss as possible. For example, for a JPEG image the first entry should be an RGB image, even though the image data is stored internally in a YCbCr color space.

Annotations
@Override
getNumImagesback to summary
public int getNumImages(boolean allowSearch) throws IOException

Implements abstract javax.imageio.ImageReader.getNumImages.

Doc from javax.imageio.ImageReader.getNumImages.

Returns the number of images, not including thumbnails, available from the current input source.

Note that some image formats (such as animated GIF) do not specify how many images are present in the stream. Thus determining the number of images will require the entire stream to be scanned and may require memory for buffering. If images are to be processed in order, it may be more efficient to simply call read with increasing indices until an IndexOutOfBoundsException is thrown to indicate that no more images are available. The allowSearch parameter may be set to false to indicate that an exhaustive search is not desired; the return value will be -1 to indicate that a search is necessary. If the input has been specified with seekForwardOnly set to true, this method throws an IllegalStateException if allowSearch is set to true.

Annotations
@Override
Exceptions
IOException:
if an error occurs reading the information from the input source.
getNumThumbnailsback to summary
public int getNumThumbnails(int imageIndex) throws IOException

Overrides javax.imageio.ImageReader.getNumThumbnails.

Doc from javax.imageio.ImageReader.getNumThumbnails.

Returns the number of thumbnail preview images associated with the given image. If the format does not support thumbnails, (readerSupportsThumbnails returns false), 0 will be returned regardless of whether an input source has been set or whether imageIndex is in bounds.

The default implementation returns 0 without checking its argument.

Annotations
@Override
Exceptions
IOException:
if an error occurs during reading.
getPlanarConfigurationback to summary
private int getPlanarConfiguration()
getStreamMetadataback to summary
public IIOMetadata getStreamMetadata() throws IIOException

Implements abstract javax.imageio.ImageReader.getStreamMetadata.

Doc from javax.imageio.ImageReader.getStreamMetadata.

Returns an IIOMetadata object representing the metadata associated with the input source as a whole (i.e., not associated with any particular image), or null if the reader does not support reading metadata, is set to ignore metadata, or if no metadata is available.

Annotations
@Override
getStreamMetadataback to summary
public IIOMetadata getStreamMetadata(int imageIndex) throws IIOException
getTileHeightback to summary
public int getTileHeight(int imageIndex) throws IOException

Overrides javax.imageio.ImageReader.getTileHeight.

Doc from javax.imageio.ImageReader.getTileHeight.

Returns the height of a tile in the given image.

The default implementation simply returns getHeight(imageIndex), which is correct for non-tiled images. Readers that support tiling should override this method.

Annotations
@Override
Exceptions
IOException:
if an error occurs during reading.
getTileOrStripByteCountback to summary
private long getTileOrStripByteCount(int tileIndex) throws IOException
getTileOrStripHeightback to summary
private int getTileOrStripHeight()
getTileOrStripOffsetback to summary
private long getTileOrStripOffset(int tileIndex) throws IIOException
getTileOrStripWidthback to summary
private int getTileOrStripWidth()
getTileWidthback to summary
public int getTileWidth(int imageIndex) throws IOException

Overrides javax.imageio.ImageReader.getTileWidth.

Doc from javax.imageio.ImageReader.getTileWidth.

Returns the width of a tile in the given image.

The default implementation simply returns getWidth(imageIndex), which is correct for non-tiled images. Readers that support tiling should override this method.

Annotations
@Override
Exceptions
IOException:
if an error occurs during reading.
getWidthback to summary
private int getWidth()
getWidthback to summary
public int getWidth(int imageIndex) throws IOException

Implements abstract javax.imageio.ImageReader.getWidth.

Doc from javax.imageio.ImageReader.getWidth.

Returns the width in pixels of the given image within the input source.

If the image can be rendered to a user-specified size, then this method returns the default width.

Annotations
@Override
Exceptions
IOException:
if an error occurs reading the width information from the input source.
hasThumbnailsback to summary
public boolean hasThumbnails(int imageIndex)

Overrides javax.imageio.ImageReader.hasThumbnails.

Doc from javax.imageio.ImageReader.hasThumbnails.

Returns true if the given image has thumbnail preview images associated with it. If the format does not support thumbnails (readerSupportsThumbnails returns false), false will be returned regardless of whether an input source has been set or whether imageIndex is in bounds.

The default implementation returns true if getNumThumbnails returns a value greater than 0.

Annotations
@Override
iceilback to summary
private static int iceil(int num, int den)
ifloorback to summary
private static int ifloor(int num, int den)
initializeFromMetadataback to summary
private void initializeFromMetadata() throws IIOException

Initializes these instance variables from the image metadata:

compression
width
height
samplesPerPixel
numBands
colorMap
photometricInterpretation
sampleFormat
bitsPerSample
extraSamples
tileOrStripWidth
tileOrStripHeight
isImageTiledback to summary
public boolean isImageTiled(int imageIndex) throws IOException

Overrides javax.imageio.ImageReader.isImageTiled.

Doc from javax.imageio.ImageReader.isImageTiled.

Returns true if the image is organized into tiles, that is, equal-sized non-overlapping rectangles.

A reader plug-in may choose whether or not to expose tiling that is present in the image as it is stored. It may even choose to advertise tiling when none is explicitly present. In general, tiling should only be advertised if there is some advantage (in speed or space) to accessing individual tiles. Regardless of whether the reader advertises tiling, it must be capable of reading an arbitrary rectangular region specified in an ImageReadParam.

A reader for which all images are guaranteed to be tiled, or are guaranteed not to be tiled, may return true or false respectively without accessing any image data. In such cases, it is not necessary to throw an exception even if no input source has been set or the image index is out of bounds.

The default implementation just returns false.

Annotations
@Override
Exceptions
IOException:
if an error occurs during reading.
isRandomAccessEasyback to summary
public boolean isRandomAccessEasy(int imageIndex) throws IOException

Overrides javax.imageio.ImageReader.isRandomAccessEasy.

Doc from javax.imageio.ImageReader.isRandomAccessEasy.

Returns true if the storage format of the given image places no inherent impediment on random access to pixels. For most compressed formats, such as JPEG, this method should return false, as a large section of the image in addition to the region of interest may need to be decoded.

This is merely a hint for programs that wish to be efficient; all readers must be able to read arbitrary regions as specified in an ImageReadParam.

Note that formats that return false from this method may nonetheless allow tiling (e.g. Restart Markers in JPEG), and random access will likely be reasonably efficient on tiles. See isImageTiled.

A reader for which all images are guaranteed to support easy random access, or are guaranteed not to support easy random access, may return true or false respectively without accessing any image data. In such cases, it is not necessary to throw an exception even if no input source has been set or the image index is out of bounds.

The default implementation returns false.

Annotations
@Override
Exceptions
IOException:
if an error occurs during reading.
locateImageback to summary
private int locateImage(int imageIndex) throws IIOException
prepareReadback to summary
private void prepareRead(int imageIndex, ImageReadParam param) throws IOException
readback to summary
public BufferedImage read(int imageIndex, ImageReadParam param) throws IOException

Implements abstract javax.imageio.ImageReader.read.

Doc from javax.imageio.ImageReader.read.

Reads the image indexed by imageIndex and returns it as a complete BufferedImage, using a supplied ImageReadParam.

The actual BufferedImage returned will be chosen using the algorithm defined by the getDestination method.

Any registered IIOReadProgressListener objects will be notified by calling their imageStarted method, followed by calls to their imageProgress method as the read progresses. Finally their imageComplete method will be called. IIOReadUpdateListener objects may be updated at other times during the read as pixels are decoded. Finally, IIOReadWarningListener objects will receive notification of any non-fatal warnings that occur during decoding.

The set of source bands to be read and destination bands to be written is determined by calling getSourceBands and getDestinationBands on the supplied ImageReadParam. If the lengths of the arrays returned by these methods differ, the set of source bands contains an index larger that the largest available source index, or the set of destination bands contains an index larger than the largest legal destination index, an IllegalArgumentException is thrown.

If the supplied ImageReadParam contains optional setting values not supported by this reader (e.g. source render size or any format-specific settings), they will be ignored.

Annotations
@Override
Exceptions
IOException:
if an error occurs during reading.
readAsRenderedImageback to summary
public RenderedImage readAsRenderedImage(int imageIndex, ImageReadParam param) throws IOException

Overrides javax.imageio.ImageReader.readAsRenderedImage.

Doc from javax.imageio.ImageReader.readAsRenderedImage.

Returns a RenderedImage object that contains the contents of the image indexed by imageIndex. By default, the returned image is simply the BufferedImage returned by read(imageIndex, param).

The semantics of this method may differ from those of the other read methods in several ways. First, any destination image and/or image type set in the ImageReadParam may be ignored. Second, the usual listener calls are not guaranteed to be made, or to be meaningful if they are. This is because the returned image may not be fully populated with pixel data at the time it is returned, or indeed at any time.

If the supplied ImageReadParam contains optional setting values not supported by this reader (e.g. source render size or any format-specific settings), they will be ignored.

The default implementation just calls read(imageIndex, param).

Annotations
@Override
Exceptions
IOException:
if an error occurs during reading.
readHeaderback to summary
private void readHeader() throws IIOException
readMetadataback to summary
private void readMetadata() throws IIOException
readRasterback to summary
public Raster readRaster(int imageIndex, ImageReadParam param) throws IOException

Overrides javax.imageio.ImageReader.readRaster.

Doc from javax.imageio.ImageReader.readRaster.

Returns a new Raster object containing the raw pixel data from the image stream, without any color conversion applied. The application must determine how to interpret the pixel data by other means. Any destination or image-type parameters in the supplied ImageReadParam object are ignored, but all other parameters are used exactly as in the read method, except that any destination offset is used as a logical rather than a physical offset. The size of the returned Raster will always be that of the source region clipped to the actual image. Logical offsets in the stream itself are ignored.

This method allows formats that normally apply a color conversion, such as JPEG, and formats that do not normally have an associated colorspace, such as remote sensing or medical imaging data, to provide access to raw pixel data.

Any registered readUpdateListeners are ignored, as there is no BufferedImage, but all other listeners are called exactly as they are for the read method.

If canReadRaster() returns false, this method throws an UnsupportedOperationException.

If the supplied ImageReadParam contains optional setting values not supported by this reader (e.g. source render size or any format-specific settings), they will be ignored.

The default implementation throws an UnsupportedOperationException.

Annotations
@Override
Exceptions
IOException:
if an error occurs during reading.
readSupportsThumbnailsback to summary
public boolean readSupportsThumbnails()
readTileback to summary
public BufferedImage readTile(int imageIndex, int tileX, int tileY) throws IOException

Overrides javax.imageio.ImageReader.readTile.

Doc from javax.imageio.ImageReader.readTile.

Reads the tile indicated by the tileX and tileY arguments, returning it as a BufferedImage. If the arguments are out of range, an IllegalArgumentException is thrown. If the image is not tiled, the values 0, 0 will return the entire image; any other values will cause an IllegalArgumentException to be thrown.

This method is merely a convenience equivalent to calling read(int, ImageReadParam) with a read param specifying a source region having offsets of tileX*getTileWidth(imageIndex), tileY*getTileHeight(imageIndex) and width and height of getTileWidth(imageIndex), getTileHeight(imageIndex); and subsampling factors of 1 and offsets of 0. To subsample a tile, call read with a read param specifying this region and different subsampling parameters.

The default implementation returns the entire image if tileX and tileY are 0, or throws an IllegalArgumentException otherwise.

Annotations
@Override
Exceptions
IOException:
if an error occurs during reading.
reportProgressback to summary
private void reportProgress()
resetback to summary
public void reset()

Overrides javax.imageio.ImageReader.reset.

Doc from javax.imageio.ImageReader.reset.

Restores the ImageReader to its initial state.

The default implementation calls setInput(null, false), setLocale(null), removeAllIIOReadUpdateListeners(), removeAllIIOReadWarningListeners(), removeAllIIOReadProgressListeners(), and clearAbortRequest.

Annotations
@Override
resetLocalback to summary
protected void resetLocal()
seekToImageback to summary
private void seekToImage(int imageIndex) throws IIOException
setInputback to summary
public void setInput(Object input, boolean seekForwardOnly, boolean ignoreMetadata)

Overrides javax.imageio.ImageReader.setInput.

Doc from javax.imageio.ImageReader.setInput.

Sets the input source to use to the given ImageInputStream or other Object. The input source must be set before any of the query or read methods are used. If input is null, any currently set input source will be removed. In any case, the value of minIndex will be initialized to 0.

The seekForwardOnly parameter controls whether the value returned by getMinIndex will be increased as each image (or thumbnail, or image metadata) is read. If seekForwardOnly is true, then a call to read(index) will throw an IndexOutOfBoundsException if index < this.minIndex; otherwise, the value of minIndex will be set to index. If seekForwardOnly is false, the value of minIndex will remain 0 regardless of any read operations.

The ignoreMetadata parameter, if set to true, allows the reader to disregard any metadata encountered during the read. Subsequent calls to the getStreamMetadata and getImageMetadata methods may return null, and an IIOImage returned from readAll may return null from their getMetadata method. Setting this parameter may allow the reader to work more efficiently. The reader may choose to disregard this setting and return metadata normally.

Subclasses should take care to remove any cached information based on the previous stream, such as header information or partially decoded image data.

Use of a general Object other than an ImageInputStream is intended for readers that interact directly with a capture device or imaging protocol. The set of legal classes is advertised by the reader's service provider's getInputTypes method; most readers will return a single-element array containing only ImageInputStream.class to indicate that they accept only an ImageInputStream.

The default implementation checks the input argument against the list returned by originatingProvider.getInputTypes() and fails if the argument is not an instance of one of the classes in the list. If the originating provider is set to null, the input is accepted only if it is an ImageInputStream.

Annotations
@Override