public class

GIFImageReaderSpi

extends ImageReaderSpi
java.lang.Object
   ↳ javax.imageio.spi.IIOServiceProvider
     ↳ javax.imageio.spi.ImageReaderWriterSpi
       ↳ javax.imageio.spi.ImageReaderSpi
         ↳ com.sun.imageio.plugins.gif.GIFImageReaderSpi

Summary

[Expand]
Inherited Fields
From class javax.imageio.spi.ImageReaderSpi
From class javax.imageio.spi.ImageReaderWriterSpi
From class javax.imageio.spi.IIOServiceProvider
Public Constructors
GIFImageReaderSpi()
Public Methods
boolean canDecodeInput(Object input)
Returns true if the supplied source object appears to be of the format supported by this reader.
ImageReader createReaderInstance(Object extension)
Returns an instance of the ImageReader implementation associated with this service provider.
String getDescription(Locale locale)
Returns a brief, human-readable description of this service provider and its associated implementation.
[Expand]
Inherited Methods
From class javax.imageio.spi.ImageReaderSpi
From class javax.imageio.spi.ImageReaderWriterSpi
From class javax.imageio.spi.IIOServiceProvider
From class java.lang.Object
From interface javax.imageio.spi.RegisterableService

Public Constructors

public GIFImageReaderSpi ()

Public Methods

public boolean canDecodeInput (Object input)

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
input the object (typically an ImageInputStream) to be decoded.
Returns
  • true if it is likely that this stream can be decoded.
Throws
IOException

public ImageReader createReaderInstance (Object extension)

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.

public String getDescription (Locale locale)

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.

Parameters
locale a Locale for which the return value should be localized.
Returns
  • a String containing a description of this service provider.