java.lang.Objectjavax.imageio.spi.IIOServiceProvider
javax.imageio.spi.ImageReaderWriterSpi
javax.imageio.spi.ImageReaderSpi
All Implemented Interfaces:
RegisterableService
ImageReader
s.
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 ImageReader
s 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 ImageReader
s
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.
Field Summary | ||
---|---|---|
public static final Class[] | STANDARD_INPUT_TYPE | A single-element array, initially containing
ImageInputStream.class , to be returned from
getInputTypes . |
protected Class[] | inputTypes | An array of Class objects to be returned from
getInputTypes , initially null . |
protected String[] | writerSpiNames | An array of strings to be returned from
getImageWriterSpiNames , initially
null . |
Fields inherited from javax.imageio.spi.IIOServiceProvider: |
---|
vendorName, version |
Constructor: |
---|
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 with a given
set of values.
|
Method from javax.imageio.spi.ImageReaderSpi Summary: |
---|
canDecodeInput, createReaderInstance, createReaderInstance, getImageWriterSpiNames, getInputTypes, isOwnReader |
Methods from javax.imageio.spi.IIOServiceProvider: |
---|
getDescription, getVendorName, getVersion, onDeregistration, onRegistration |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from javax.imageio.spi.ImageReaderSpi Detail: |
---|
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 Formats such as "raw," which can potentially attempt
to read nearly any stream, should return If |
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
|
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 Typically, a plug-in will implement this method using code
such as |
String s 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
ImageWriter s 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 This mechanism may be used to obtain
|
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
|
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 |