javax.imageio.spi
Class ImageReaderSpi

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.imageio.spi.IIOServiceProvider sample code for javax.imageio.spi.IIOServiceProvider definition code for javax.imageio.spi.IIOServiceProvider 
      extended by javax.imageio.spi.ImageReaderWriterSpi sample code for javax.imageio.spi.ImageReaderWriterSpi definition code for javax.imageio.spi.ImageReaderWriterSpi 
          extended by javax.imageio.spi.ImageReaderSpi
All Implemented Interfaces:
RegisterableService sample code for javax.imageio.spi.RegisterableService definition code for javax.imageio.spi.RegisterableService

public abstract class ImageReaderSpi
extends ImageReaderWriterSpi sample code for javax.imageio.spi.ImageReaderWriterSpi definition code for javax.imageio.spi.ImageReaderWriterSpi

The service provider interface (SPI) for ImageReaders. For more information on service provider classes, see the class comment for the IIORegistry class.

Each ImageReaderSpi provides several types of information about the ImageReader class with which it is associated.

The name of the vendor who defined the SPI class and a brief description of the class are available via the getVendorName, getDescription, and getVersion methods. These methods may be internationalized to provide locale-specific output. These methods are intended mainly to provide short, human-readable information that might be used to organize a pop-up menu or other list.

Lists of format names, file suffixes, and MIME types associated with the service may be obtained by means of the getFormatNames, getFileSuffixes, and getMIMETypes methods. These methods may be used to identify candidate ImageReaders for decoding a particular file or stream based on manual format selection, file naming, or MIME associations (for example, when accessing a file over HTTP or as an email attachment).

A more reliable way to determine which ImageReaders are likely to be able to parse a particular data stream is provided by the canDecodeInput method. This methods allows the service provider to inspect the actual stream contents.

Finally, an instance of the ImageReader class associated with this service provider may be obtained by calling the createReaderInstance method. Any heavyweight initialization, such as the loading of native libraries or creation of large tables, should be deferred at least until the first invocation of this method.

See Also:
IIORegistry sample code for javax.imageio.spi.IIORegistry definition code for javax.imageio.spi.IIORegistry , ImageReader sample code for javax.imageio.ImageReader definition code for javax.imageio.ImageReader

Field Summary
protected  Class sample code for java.lang.Class definition code for java.lang.Class [] inputTypes sample code for javax.imageio.spi.ImageReaderSpi.inputTypes definition code for javax.imageio.spi.ImageReaderSpi.inputTypes
          An array of Class objects to be returned from getInputTypes, initially null.
static Class sample code for java.lang.Class definition code for java.lang.Class [] STANDARD_INPUT_TYPE sample code for javax.imageio.spi.ImageReaderSpi.STANDARD_INPUT_TYPE definition code for javax.imageio.spi.ImageReaderSpi.STANDARD_INPUT_TYPE
          A single-element array, initially containing ImageInputStream.class, to be returned from getInputTypes.
protected  String sample code for java.lang.String definition code for java.lang.String [] writerSpiNames sample code for javax.imageio.spi.ImageReaderSpi.writerSpiNames definition code for javax.imageio.spi.ImageReaderSpi.writerSpiNames
          An array of strings to be returned from getImageWriterSpiNames, initially null.
 
Fields inherited from class javax.imageio.spi.ImageReaderWriterSpi sample code for javax.imageio.spi.ImageReaderWriterSpi definition code for javax.imageio.spi.ImageReaderWriterSpi
extraImageMetadataFormatClassNames sample code for javax.imageio.spi.ImageReaderWriterSpi.extraImageMetadataFormatClassNames definition code for javax.imageio.spi.ImageReaderWriterSpi.extraImageMetadataFormatClassNames , extraImageMetadataFormatNames sample code for javax.imageio.spi.ImageReaderWriterSpi.extraImageMetadataFormatNames definition code for javax.imageio.spi.ImageReaderWriterSpi.extraImageMetadataFormatNames , extraStreamMetadataFormatClassNames sample code for javax.imageio.spi.ImageReaderWriterSpi.extraStreamMetadataFormatClassNames definition code for javax.imageio.spi.ImageReaderWriterSpi.extraStreamMetadataFormatClassNames , extraStreamMetadataFormatNames sample code for javax.imageio.spi.ImageReaderWriterSpi.extraStreamMetadataFormatNames definition code for javax.imageio.spi.ImageReaderWriterSpi.extraStreamMetadataFormatNames , MIMETypes sample code for javax.imageio.spi.ImageReaderWriterSpi.MIMETypes definition code for javax.imageio.spi.ImageReaderWriterSpi.MIMETypes , names sample code for javax.imageio.spi.ImageReaderWriterSpi.names definition code for javax.imageio.spi.ImageReaderWriterSpi.names , nativeImageMetadataFormatClassName sample code for javax.imageio.spi.ImageReaderWriterSpi.nativeImageMetadataFormatClassName definition code for javax.imageio.spi.ImageReaderWriterSpi.nativeImageMetadataFormatClassName , nativeImageMetadataFormatName sample code for javax.imageio.spi.ImageReaderWriterSpi.nativeImageMetadataFormatName definition code for javax.imageio.spi.ImageReaderWriterSpi.nativeImageMetadataFormatName , nativeStreamMetadataFormatClassName sample code for javax.imageio.spi.ImageReaderWriterSpi.nativeStreamMetadataFormatClassName definition code for javax.imageio.spi.ImageReaderWriterSpi.nativeStreamMetadataFormatClassName , nativeStreamMetadataFormatName sample code for javax.imageio.spi.ImageReaderWriterSpi.nativeStreamMetadataFormatName definition code for javax.imageio.spi.ImageReaderWriterSpi.nativeStreamMetadataFormatName , pluginClassName sample code for javax.imageio.spi.ImageReaderWriterSpi.pluginClassName definition code for javax.imageio.spi.ImageReaderWriterSpi.pluginClassName , suffixes sample code for javax.imageio.spi.ImageReaderWriterSpi.suffixes definition code for javax.imageio.spi.ImageReaderWriterSpi.suffixes , supportsStandardImageMetadataFormat sample code for javax.imageio.spi.ImageReaderWriterSpi.supportsStandardImageMetadataFormat definition code for javax.imageio.spi.ImageReaderWriterSpi.supportsStandardImageMetadataFormat , supportsStandardStreamMetadataFormat sample code for javax.imageio.spi.ImageReaderWriterSpi.supportsStandardStreamMetadataFormat definition code for javax.imageio.spi.ImageReaderWriterSpi.supportsStandardStreamMetadataFormat
 
Fields inherited from class javax.imageio.spi.IIOServiceProvider sample code for javax.imageio.spi.IIOServiceProvider definition code for javax.imageio.spi.IIOServiceProvider
vendorName sample code for javax.imageio.spi.IIOServiceProvider.vendorName definition code for javax.imageio.spi.IIOServiceProvider.vendorName , version sample code for javax.imageio.spi.IIOServiceProvider.version definition code for javax.imageio.spi.IIOServiceProvider.version
 
Constructor Summary
protected ImageReaderSpi sample code for javax.imageio.spi.ImageReaderSpi.ImageReaderSpi() definition code for javax.imageio.spi.ImageReaderSpi.ImageReaderSpi() ()
          Constructs a blank ImageReaderSpi.
  ImageReaderSpi sample code for javax.imageio.spi.ImageReaderSpi.ImageReaderSpi(java.lang.String, java.lang.String, java.lang.String[], java.lang.String[], java.lang.String[], java.lang.String, java.lang.Class[], java.lang.String[], boolean, java.lang.String, java.lang.String, java.lang.String[], java.lang.String[], boolean, java.lang.String, java.lang.String, java.lang.String[], java.lang.String[]) definition code for javax.imageio.spi.ImageReaderSpi.ImageReaderSpi(java.lang.String, java.lang.String, java.lang.String[], java.lang.String[], java.lang.String[], java.lang.String, java.lang.Class[], java.lang.String[], boolean, java.lang.String, java.lang.String, java.lang.String[], java.lang.String[], boolean, java.lang.String, java.lang.String, java.lang.String[], java.lang.String[]) (String sample code for java.lang.String definition code for java.lang.String  vendorName, String sample code for java.lang.String definition code for java.lang.String  version, String sample code for java.lang.String definition code for java.lang.String [] names, String sample code for java.lang.String definition code for java.lang.String [] suffixes, String sample code for java.lang.String definition code for java.lang.String [] MIMETypes, String sample code for java.lang.String definition code for java.lang.String  readerClassName, Class sample code for java.lang.Class definition code for java.lang.Class [] inputTypes, String sample code for java.lang.String definition code for java.lang.String [] writerSpiNames, boolean supportsStandardStreamMetadataFormat, String sample code for java.lang.String definition code for java.lang.String  nativeStreamMetadataFormatName, String sample code for java.lang.String definition code for java.lang.String  nativeStreamMetadataFormatClassName, String sample code for java.lang.String definition code for java.lang.String [] extraStreamMetadataFormatNames, String sample code for java.lang.String definition code for java.lang.String [] extraStreamMetadataFormatClassNames, boolean supportsStandardImageMetadataFormat, String sample code for java.lang.String definition code for java.lang.String  nativeImageMetadataFormatName, String sample code for java.lang.String definition code for java.lang.String  nativeImageMetadataFormatClassName, String sample code for java.lang.String definition code for java.lang.String [] extraImageMetadataFormatNames, String sample code for java.lang.String definition code for java.lang.String [] extraImageMetadataFormatClassNames)
          Constructs an ImageReaderSpi with a given set of values.
 
Method Summary
abstract  boolean canDecodeInput sample code for javax.imageio.spi.ImageReaderSpi.canDecodeInput(java.lang.Object) definition code for javax.imageio.spi.ImageReaderSpi.canDecodeInput(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  source)
          Returns true if the supplied source object appears to be of the format supported by this reader.
 ImageReader sample code for javax.imageio.ImageReader definition code for javax.imageio.ImageReader createReaderInstance sample code for javax.imageio.spi.ImageReaderSpi.createReaderInstance() definition code for javax.imageio.spi.ImageReaderSpi.createReaderInstance() ()
          Returns an instance of the ImageReader implementation associated with this service provider.
abstract  ImageReader sample code for javax.imageio.ImageReader definition code for javax.imageio.ImageReader createReaderInstance sample code for javax.imageio.spi.ImageReaderSpi.createReaderInstance(java.lang.Object) definition code for javax.imageio.spi.ImageReaderSpi.createReaderInstance(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  extension)
          Returns an instance of the ImageReader implementation associated with this service provider.
 String sample code for java.lang.String definition code for java.lang.String [] getImageWriterSpiNames sample code for javax.imageio.spi.ImageReaderSpi.getImageWriterSpiNames() definition code for javax.imageio.spi.ImageReaderSpi.getImageWriterSpiNames() ()
          Returns an array of Strings containing the fully qualified names of all the ImageWriterSpi classes that can understand the internal metadata representation used by the ImageReader associated with this service provider, or null if there are no such ImageWriters specified.
 Class sample code for java.lang.Class definition code for java.lang.Class [] getInputTypes sample code for javax.imageio.spi.ImageReaderSpi.getInputTypes() definition code for javax.imageio.spi.ImageReaderSpi.getInputTypes() ()
          Returns an array of Class objects indicating what types of objects may be used as arguments to the reader's setInput method.
 boolean isOwnReader sample code for javax.imageio.spi.ImageReaderSpi.isOwnReader(javax.imageio.ImageReader) definition code for javax.imageio.spi.ImageReaderSpi.isOwnReader(javax.imageio.ImageReader) (ImageReader sample code for javax.imageio.ImageReader definition code for javax.imageio.ImageReader  reader)
          Returns true if the ImageReader object passed in is an instance of the ImageReader associated with this service provider.
 
Methods inherited from class javax.imageio.spi.ImageReaderWriterSpi sample code for javax.imageio.spi.ImageReaderWriterSpi definition code for javax.imageio.spi.ImageReaderWriterSpi
getExtraImageMetadataFormatNames sample code for javax.imageio.spi.ImageReaderWriterSpi.getExtraImageMetadataFormatNames() definition code for javax.imageio.spi.ImageReaderWriterSpi.getExtraImageMetadataFormatNames() , getExtraStreamMetadataFormatNames sample code for javax.imageio.spi.ImageReaderWriterSpi.getExtraStreamMetadataFormatNames() definition code for javax.imageio.spi.ImageReaderWriterSpi.getExtraStreamMetadataFormatNames() , getFileSuffixes sample code for javax.imageio.spi.ImageReaderWriterSpi.getFileSuffixes() definition code for javax.imageio.spi.ImageReaderWriterSpi.getFileSuffixes() , getFormatNames sample code for javax.imageio.spi.ImageReaderWriterSpi.getFormatNames() definition code for javax.imageio.spi.ImageReaderWriterSpi.getFormatNames() , getImageMetadataFormat sample code for javax.imageio.spi.ImageReaderWriterSpi.getImageMetadataFormat(java.lang.String) definition code for javax.imageio.spi.ImageReaderWriterSpi.getImageMetadataFormat(java.lang.String) , getMIMETypes sample code for javax.imageio.spi.ImageReaderWriterSpi.getMIMETypes() definition code for javax.imageio.spi.ImageReaderWriterSpi.getMIMETypes() , getNativeImageMetadataFormatName sample code for javax.imageio.spi.ImageReaderWriterSpi.getNativeImageMetadataFormatName() definition code for javax.imageio.spi.ImageReaderWriterSpi.getNativeImageMetadataFormatName() , getNativeStreamMetadataFormatName sample code for javax.imageio.spi.ImageReaderWriterSpi.getNativeStreamMetadataFormatName() definition code for javax.imageio.spi.ImageReaderWriterSpi.getNativeStreamMetadataFormatName() , getPluginClassName sample code for javax.imageio.spi.ImageReaderWriterSpi.getPluginClassName() definition code for javax.imageio.spi.ImageReaderWriterSpi.getPluginClassName() , getStreamMetadataFormat sample code for javax.imageio.spi.ImageReaderWriterSpi.getStreamMetadataFormat(java.lang.String) definition code for javax.imageio.spi.ImageReaderWriterSpi.getStreamMetadataFormat(java.lang.String) , isStandardImageMetadataFormatSupported sample code for javax.imageio.spi.ImageReaderWriterSpi.isStandardImageMetadataFormatSupported() definition code for javax.imageio.spi.ImageReaderWriterSpi.isStandardImageMetadataFormatSupported() , isStandardStreamMetadataFormatSupported sample code for javax.imageio.spi.ImageReaderWriterSpi.isStandardStreamMetadataFormatSupported() definition code for javax.imageio.spi.ImageReaderWriterSpi.isStandardStreamMetadataFormatSupported()
 
Methods inherited from class javax.imageio.spi.IIOServiceProvider sample code for javax.imageio.spi.IIOServiceProvider definition code for javax.imageio.spi.IIOServiceProvider
getDescription sample code for javax.imageio.spi.IIOServiceProvider.getDescription(java.util.Locale) definition code for javax.imageio.spi.IIOServiceProvider.getDescription(java.util.Locale) , getVendorName sample code for javax.imageio.spi.IIOServiceProvider.getVendorName() definition code for javax.imageio.spi.IIOServiceProvider.getVendorName() , getVersion sample code for javax.imageio.spi.IIOServiceProvider.getVersion() definition code for javax.imageio.spi.IIOServiceProvider.getVersion() , onDeregistration sample code for javax.imageio.spi.IIOServiceProvider.onDeregistration(javax.imageio.spi.ServiceRegistry, java.lang.Class) definition code for javax.imageio.spi.IIOServiceProvider.onDeregistration(javax.imageio.spi.ServiceRegistry, java.lang.Class) , onRegistration sample code for javax.imageio.spi.IIOServiceProvider.onRegistration(javax.imageio.spi.ServiceRegistry, java.lang.Class) definition code for javax.imageio.spi.IIOServiceProvider.onRegistration(javax.imageio.spi.ServiceRegistry, java.lang.Class)
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

STANDARD_INPUT_TYPE sample code for javax.imageio.spi.ImageReaderSpi.STANDARD_INPUT_TYPE

public static final Class sample code for java.lang.Class definition code for java.lang.Class [] STANDARD_INPUT_TYPE
A single-element array, initially containing ImageInputStream.class, to be returned from getInputTypes.


inputTypes sample code for javax.imageio.spi.ImageReaderSpi.inputTypes

protected Class sample code for java.lang.Class definition code for java.lang.Class [] inputTypes
An array of Class objects to be returned from getInputTypes, initially null.


writerSpiNames sample code for javax.imageio.spi.ImageReaderSpi.writerSpiNames

protected String sample code for java.lang.String definition code for java.lang.String [] writerSpiNames
An array of strings to be returned from getImageWriterSpiNames, initially null.

Constructor Detail

ImageReaderSpi sample code for javax.imageio.spi.ImageReaderSpi() definition code for javax.imageio.spi.ImageReaderSpi()

protected ImageReaderSpi()
Constructs a blank ImageReaderSpi. It is up to the subclass to initialize instance variables and/or override method implementations in order to provide working versions of all methods.


ImageReaderSpi sample code for javax.imageio.spi.ImageReaderSpi(java.lang.String, java.lang.String, java.lang.String[], java.lang.String[], java.lang.String[], java.lang.String, java.lang.Class[], java.lang.String[], boolean, java.lang.String, java.lang.String, java.lang.String[], java.lang.String[], boolean, java.lang.String, java.lang.String, java.lang.String[], java.lang.String[]) definition code for javax.imageio.spi.ImageReaderSpi(java.lang.String, java.lang.String, java.lang.String[], java.lang.String[], java.lang.String[], java.lang.String, java.lang.Class[], java.lang.String[], boolean, java.lang.String, java.lang.String, java.lang.String[], java.lang.String[], boolean, java.lang.String, java.lang.String, java.lang.String[], java.lang.String[])

public ImageReaderSpi(String sample code for java.lang.String definition code for java.lang.String  vendorName,
                      String sample code for java.lang.String definition code for java.lang.String  version,
                      String sample code for java.lang.String definition code for java.lang.String [] names,
                      String sample code for java.lang.String definition code for java.lang.String [] suffixes,
                      String sample code for java.lang.String definition code for java.lang.String [] MIMETypes,
                      String sample code for java.lang.String definition code for java.lang.String  readerClassName,
                      Class sample code for java.lang.Class definition code for java.lang.Class [] inputTypes,
                      String sample code for java.lang.String definition code for java.lang.String [] writerSpiNames,
                      boolean supportsStandardStreamMetadataFormat,
                      String sample code for java.lang.String definition code for java.lang.String  nativeStreamMetadataFormatName,
                      String sample code for java.lang.String definition code for java.lang.String  nativeStreamMetadataFormatClassName,
                      String sample code for java.lang.String definition code for java.lang.String [] extraStreamMetadataFormatNames,
                      String sample code for java.lang.String definition code for java.lang.String [] extraStreamMetadataFormatClassNames,
                      boolean supportsStandardImageMetadataFormat,
                      String sample code for java.lang.String definition code for java.lang.String  nativeImageMetadataFormatName,
                      String sample code for java.lang.String definition code for java.lang.String  nativeImageMetadataFormatClassName,
                      String sample code for java.lang.String definition code for java.lang.String [] extraImageMetadataFormatNames,
                      String sample code for java.lang.String definition code for java.lang.String [] extraImageMetadataFormatClassNames)
Constructs an ImageReaderSpi with a given set of values.

Parameters:
vendorName - the vendor name, as a non-null String.
version - a version identifier, as a non-null String.
names - a non-null array of Strings indicating the format names. At least one entry must be present.
suffixes - an array of Strings indicating the common file suffixes. If no suffixes are defined, null should be supplied. An array of length 0 will be normalized to null.
MIMETypes - an array of Strings indicating the format's MIME types. If no MIME types are defined, null should be supplied. An array of length 0 will be normalized to null.
readerClassName - the fully-qualified name of the associated ImageReader class, as a non-null String.
inputTypes - a non-null array of Class objects of length at least 1 indicating the legal input types.
writerSpiNames - an array Strings naming the classes of all associated ImageWriters, or null. An array of length 0 is normalized to null.
supportsStandardStreamMetadataFormat - a boolean that indicates whether a stream metadata object can use trees described by the standard metadata format.
nativeStreamMetadataFormatName - a String, or null, to be returned from getNativeStreamMetadataFormatName.
nativeStreamMetadataFormatClassName - a String, or null, to be used to instantiate a metadata format object to be returned from getNativeStreamMetadataFormat.
extraStreamMetadataFormatNames - an array of Strings, or null, to be returned from getExtraStreamMetadataFormatNames. An array of length 0 is normalized to null.
extraStreamMetadataFormatClassNames - an array of Strings, or null, to be used to instantiate a metadata format object to be returned from getStreamMetadataFormat. An array of length 0 is normalized to null.
supportsStandardImageMetadataFormat - a boolean that indicates whether an image metadata object can use trees described by the standard metadata format.
nativeImageMetadataFormatName - a String, or null, to be returned from getNativeImageMetadataFormatName.
nativeImageMetadataFormatClassName - a String, or null, to be used to instantiate a metadata format object to be returned from getNativeImageMetadataFormat.
extraImageMetadataFormatNames - an array of Strings to be returned from getExtraImageMetadataFormatNames. An array of length 0 is normalized to null.
extraImageMetadataFormatClassNames - an array of Strings, or null, to be used to instantiate a metadata format object to be returned from getImageMetadataFormat. An array of length 0 is normalized to null.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if vendorName is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if version is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if names is null or has length 0.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if readerClassName is null.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if inputTypes is null or has length 0.
Method Detail

getInputTypes sample code for javax.imageio.spi.ImageReaderSpi.getInputTypes() definition code for javax.imageio.spi.ImageReaderSpi.getInputTypes()

public Class sample code for java.lang.Class definition code for java.lang.Class [] getInputTypes()
Returns an array of Class objects indicating what types of objects may be used as arguments to the reader's setInput method.

For most readers, which only accept input from an ImageInputStream, a single-element array containing ImageInputStream.class should be returned.

Returns:
a non-null array of Classobjects of length at least 1.

canDecodeInput sample code for javax.imageio.spi.ImageReaderSpi.canDecodeInput(java.lang.Object) definition code for javax.imageio.spi.ImageReaderSpi.canDecodeInput(java.lang.Object)

public abstract boolean canDecodeInput(Object sample code for java.lang.Object definition code for java.lang.Object  source)
                                throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Returns true if the supplied source object appears to be of the format supported by this reader. Returning true from this method does not guarantee that reading will succeed, only that there appears to be a reasonable chance of success based on a brief inspection of the stream contents. If the source is an ImageInputStream, implementations will commonly check the first several bytes of the stream for a "magic number" associated with the format. Once actual reading has commenced, the reader may still indicate failure at any time prior to the completion of decoding.

It is important that the state of the object not be disturbed in order that other ImageReaderSpis can properly determine whether they are able to decode the object. In particular, if the source is an ImageInputStream, a mark/reset pair should be used to preserve the stream position.

Formats such as "raw," which can potentially attempt to read nearly any stream, should return false in order to avoid being invoked in preference to a closer match.

If source is not an instance of one of the classes returned by getInputTypes, the method should simply return false.

Parameters:
source - the object (typically an ImageInputStream) to be decoded.
Returns:
true if it is likely that this stream can be decoded.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if source is null.
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error occurs while reading the stream.

createReaderInstance sample code for javax.imageio.spi.ImageReaderSpi.createReaderInstance() definition code for javax.imageio.spi.ImageReaderSpi.createReaderInstance()

public ImageReader sample code for javax.imageio.ImageReader definition code for javax.imageio.ImageReader  createReaderInstance()
                                 throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Returns an instance of the ImageReader implementation associated with this service provider. The returned object will initially be in an initial state as if its reset method had been called.

The default implementation simply returns createReaderInstance(null).

Returns:
an ImageReader instance.
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if an error occurs during loading, or initialization of the reader class, or during instantiation or initialization of the reader object.

createReaderInstance sample code for javax.imageio.spi.ImageReaderSpi.createReaderInstance(java.lang.Object) definition code for javax.imageio.spi.ImageReaderSpi.createReaderInstance(java.lang.Object)

public abstract ImageReader sample code for javax.imageio.ImageReader definition code for javax.imageio.ImageReader  createReaderInstance(Object sample code for java.lang.Object definition code for java.lang.Object  extension)
                                          throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Returns an instance of the ImageReader implementation associated with this service provider. The returned object will initially be in an initial state as if its reset method had been called.

An Object may be supplied to the plug-in at construction time. The nature of the object is entirely plug-in specific.

Typically, a plug-in will implement this method using code such as return new MyImageReader(this).

Parameters:
extension - a plug-in specific extension object, which may be null.
Returns:
an ImageReader instance.
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if the attempt to instantiate the reader fails.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the ImageReader's contructor throws an IllegalArgumentException to indicate that the extension object is unsuitable.

isOwnReader sample code for javax.imageio.spi.ImageReaderSpi.isOwnReader(javax.imageio.ImageReader) definition code for javax.imageio.spi.ImageReaderSpi.isOwnReader(javax.imageio.ImageReader)

public boolean isOwnReader(ImageReader sample code for javax.imageio.ImageReader definition code for javax.imageio.ImageReader  reader)
Returns true if the ImageReader object passed in is an instance of the ImageReader associated with this service provider.

The default implementation compares the fully-qualified class name of the reader argument with the class name passed into the constructor. This method may be overridden if more sophisticated checking is required.

Parameters:
reader - an ImageReader instance.
Returns:
true if reader is recognized.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if reader is null.

getImageWriterSpiNames sample code for javax.imageio.spi.ImageReaderSpi.getImageWriterSpiNames() definition code for javax.imageio.spi.ImageReaderSpi.getImageWriterSpiNames()

public String sample code for java.lang.String definition code for java.lang.String [] getImageWriterSpiNames()
Returns an array of Strings containing the fully qualified names of all the ImageWriterSpi classes that can understand the internal metadata representation used by the ImageReader associated with this service provider, or null if there are no such ImageWriters specified. If a non-null value is returned, it must have non-zero length.

The first item in the array must be the name of the service provider for the "preferred" writer, as it will be used to instantiate the ImageWriter returned by ImageIO.getImageWriter(ImageReader).

This mechanism may be used to obtain ImageWriters that will understand the internal structure of non-pixel meta-data (see IIOTreeInfo) generated by an ImageReader. By obtaining this data from the ImageReader and passing it on to one of the ImageWriters obtained with this method, a client program can read an image, modify it in some way, and write it back out while preserving all meta-data, without having to understand anything about the internal structure of the meta-data, or even about the image format.

Returns:
an array of Strings of length at least 1 containing names of ImageWriterSpi, or null.
See Also:
ImageIO.getImageWriter(ImageReader) sample code for javax.imageio.ImageIO.getImageWriter(javax.imageio.ImageReader) definition code for javax.imageio.ImageIO.getImageWriter(javax.imageio.ImageReader)