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

public Class BMPImageReaderSpi

extends ImageReaderSpi
Class Inheritance
Imports
java.util.Locale, javax.imageio.spi.ImageReaderSpi, .ServiceRegistry, javax.imageio.stream.ImageInputStream, java.io.IOException, javax.imageio.ImageReader, .IIOException, com.sun.imageio.plugins.common.ReaderUtil

Field Summary

Modifier and TypeField and Description
private static String[]
private static String[]
private static String[]
private boolean
private static String[]
Inherited from javax.imageio.spi.ImageReaderSpi:
inputTypesSTANDARD_INPUT_TYPE

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
canDecodeInput(Object source)

Implements abstract javax.imageio.spi.ImageReaderSpi.canDecodeInput.

Returns true if the supplied source object appears to be of the format supported by this reader.

public ImageReader
createReaderInstance(Object extension)

Implements abstract javax.imageio.spi.ImageReaderSpi.createReaderInstance.

Returns an instance of the ImageReader implementation associated with this service provider.

public String
getDescription(Locale locale)

Implements abstract javax.imageio.spi.IIOServiceProvider.getDescription.

Returns a brief, human-readable description of this service provider and its associated implementation.

public void
onRegistration(ServiceRegistry registry, Class<?> category)

Overrides javax.imageio.spi.IIOServiceProvider.onRegistration.

Implements javax.imageio.spi.RegisterableService.onRegistration.

A callback that will be called exactly once after the Spi class has been instantiated and registered in a ServiceRegistry.

Inherited from javax.imageio.spi.ImageReaderSpi:
createReaderInstancegetImageWriterSpiNamesgetInputTypesisOwnReader

Field Detail

extensionsback to summary
private static String[] extensions
formatNamesback to summary
private static String[] formatNames
mimeTypeback to summary
private static String[] mimeType
registeredback to summary
private boolean registered
writerSpiNamesback to summary
private static String[] writerSpiNames

Hides javax.imageio.spi.ImageReaderSpi.writerSpiNames.

Constructor Detail

BMPImageReaderSpiback to summary
public BMPImageReaderSpi()

Method Detail

canDecodeInputback to summary
public boolean canDecodeInput(Object source) throws IOException

Implements abstract javax.imageio.spi.ImageReaderSpi.canDecodeInput.

Doc from javax.imageio.spi.ImageReaderSpi.canDecodeInput.

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.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs while reading the stream.
createReaderInstanceback to summary
public ImageReader createReaderInstance(Object extension) throws IIOException

Implements abstract javax.imageio.spi.ImageReaderSpi.createReaderInstance.

Doc from javax.imageio.spi.ImageReaderSpi.createReaderInstance.

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).

Annotations
@Override
getDescriptionback to summary
public String getDescription(Locale locale)

Implements abstract javax.imageio.spi.IIOServiceProvider.getDescription.

Doc from javax.imageio.spi.IIOServiceProvider.getDescription.

Returns a brief, human-readable description of this service provider and its associated implementation. The resulting string should be localized for the supplied Locale, if possible.

Annotations
@Override
onRegistrationback to summary
public void onRegistration(ServiceRegistry registry, Class<?> category)

Overrides javax.imageio.spi.IIOServiceProvider.onRegistration.

Implements javax.imageio.spi.RegisterableService.onRegistration.

Doc from javax.imageio.spi.IIOServiceProvider.onRegistration.

A callback that will be called exactly once after the Spi class has been instantiated and registered in a ServiceRegistry. This may be used to verify that the environment is suitable for this service, for example that native libraries can be loaded. If the service cannot function in the environment where it finds itself, it should deregister itself from the registry.

Only the registry should call this method.

The default implementation does nothing.

Annotations
@Override