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.
IIORegistry, javax.imageio.ImageReader
| Modifier and Type | Field and Description |
|---|---|
| protected Class | inputTypes
An array of |
| private Class | readerClass
The |
| public static final Class | STANDARD_INPUT_TYPE
Deprecated
Instead of using this field, directly create
the equivalent array A single-element array, initially containing
{ ImageInputStream.class }.
ImageInputStream.class, to be returned from
getInputTypes.
|
| protected String[] | writerSpiNames
An array of strings to be returned from
|
| Access | Constructor and Description |
|---|---|
| protected | |
| public | ImageReaderSpi(String
the vendor name, as a non- vendorName, String null
String.a version identifier, as a non- version, String[] null
String.a non- names, String[] null array of
Strings indicating the format names. At least one
entry must be present.an array of suffixes, String[] 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.an array of MIMETypes, String 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.the fully-qualified name of the
associated readerClassName, Class<?>[] ImageReader class, as a
non-null String.a non- inputTypes, String[] null array of
Class objects of length at least 1 indicating the
legal input types.an array writerSpiNames, boolean Strings naming the
classes of all associated ImageWriters, or
null. An array of length 0 is normalized to
null.a
supportsStandardStreamMetadataFormat, String boolean that indicates whether a stream metadata
object can use trees described by the standard metadata format.a
nativeStreamMetadataFormatName, String String, or null, to be returned from
getNativeStreamMetadataFormatName.a
nativeStreamMetadataFormatClassName, String[] String, or null, to be used to instantiate
a metadata format object to be returned from
getNativeStreamMetadataFormat.an array of
extraStreamMetadataFormatNames, String[] Strings, or null, to be returned from
getExtraStreamMetadataFormatNames. An array of length
0 is normalized to null.an array of
extraStreamMetadataFormatClassNames, boolean 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.a
supportsStandardImageMetadataFormat, String boolean that indicates whether an image metadata
object can use trees described by the standard metadata format.a
nativeImageMetadataFormatName, String String, or null, to be returned from
getNativeImageMetadataFormatName.a
nativeImageMetadataFormatClassName, String[] String, or null, to be used to instantiate
a metadata format object to be returned from
getNativeImageMetadataFormat.an array of
extraImageMetadataFormatNames, String[] Strings to be returned from
getExtraImageMetadataFormatNames. An array of length 0
is normalized to null.an array of
extraImageMetadataFormatClassNames)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.Constructs an |
| Modifier and Type | Method and Description |
|---|---|
| public abstract boolean | Returns: true if it is likely that this stream can
be decoded.the object (typically an
source)ImageInputStream) to be decoded.Returns |
| public ImageReader | Returns: anImageReader instance.Returns an instance of the |
| public abstract ImageReader | Returns: anImageReader instance.a plug-in specific extension object, which may
be extension)null.Returns an instance of the |
| public String[] | Returns: an array ofStrings of length at least 1
containing names of ImageWriterSpi, or
null.Returns an array of |
| public Class | Returns: a non-null array of
Class objects of length at least 1.Returns an array of |
| public boolean | Returns: true if reader is recognized.an reader)ImageReader instance.Returns |
| inputTypes | back to summary |
|---|---|
| protected Class<?>[] inputTypes An array of | |
| readerClass | back to summary |
|---|---|
| private Class<?> readerClass The | |
| STANDARD_INPUT_TYPE | back to summary |
|---|---|
| public static final Class<?>[] STANDARD_INPUT_TYPE
Deprecated Instead of using this field, directly create
the equivalent array A single-element array, initially containing
| |
| writerSpiNames | back to summary |
|---|---|
| protected String[] writerSpiNames An array of strings to be returned from
| |
| ImageReaderSpi | back to summary |
|---|---|
| protected ImageReaderSpi() Constructs a blank | |
| ImageReaderSpi | back to summary |
|---|---|
| public ImageReaderSpi(String vendorName, String version, String[] names, String[] suffixes, String[] MIMETypes, String readerClassName, Class<?>[] inputTypes, String[] writerSpiNames, boolean supportsStandardStreamMetadataFormat, String nativeStreamMetadataFormatName, String nativeStreamMetadataFormatClassName, String[] extraStreamMetadataFormatNames, String[] extraStreamMetadataFormatClassNames, boolean supportsStandardImageMetadataFormat, String nativeImageMetadataFormatName, String nativeImageMetadataFormatClassName, String[] extraImageMetadataFormatNames, String[] extraImageMetadataFormatClassNames) Constructs an
| |
| canDecodeInput | back to summary |
|---|---|
| public abstract boolean canDecodeInput(Object source) throws IOException Returns 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
| |
| createReaderInstance | back to summary |
|---|---|
| public ImageReader createReaderInstance() throws IOException Returns an instance of the The default implementation simply returns
| |
| createReaderInstance | back to summary |
|---|---|
| public abstract ImageReader createReaderInstance(Object extension) throws IOException Returns an instance of the An Typically, a plug-in will implement this method using code
such as
| |
| getImageWriterSpiNames | back to summary |
|---|---|
| public String[] getImageWriterSpiNames() Returns an array of 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
| |
| getInputTypes | back to summary |
|---|---|
| public Class Returns an array of For most readers, which only accept input from an
| |
| isOwnReader | back to summary |
|---|---|
| public boolean isOwnReader(ImageReader reader) Returns The default implementation compares the fully-qualified
class name of the
| |