org.foray.graphic.factory
Class GIFFactory

java.lang.Object
  extended by org.foray.graphic.factory.GraphicFactory
      extended by org.foray.graphic.factory.GIFFactory

public class GIFFactory
extends GraphicFactory

ImageReader object for GIF image type.

Author:
Pankaj Narula

Field Summary
protected static byte[] GIF_HEADER_1
          One possible set of header bytes at the beginning of a GIF file.
protected static byte[] GIF_HEADER_2
          One possible set of header bytes at the beginning of a GIF file.
 
Constructor Summary
GIFFactory(GraphicServer4a server)
          Constructor.
 
Method Summary
 GIFGraphic attemptCreate(URL url, BufferedInputStream bis)
          Subclasses implement this method to try to create an appropriate Graphic instance.
 
Methods inherited from class org.foray.graphic.factory.GraphicFactory
getLogger, getServer, makeGraphic, maxBytesToVerify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GIF_HEADER_1

protected static final byte[] GIF_HEADER_1
One possible set of header bytes at the beginning of a GIF file.


GIF_HEADER_2

protected static final byte[] GIF_HEADER_2
One possible set of header bytes at the beginning of a GIF file.

Constructor Detail

GIFFactory

public GIFFactory(GraphicServer4a server)
Constructor.

Parameters:
server - The parent graphic server.
Method Detail

attemptCreate

public GIFGraphic attemptCreate(URL url,
                                BufferedInputStream bis)
                         throws IOException
Description copied from class: GraphicFactory
Subclasses implement this method to try to create an appropriate Graphic instance. Note that this superclass handles the task of marking and resetting the input stream, so all the subclass needs to do is read the stream.

Specified by:
attemptCreate in class GraphicFactory
Parameters:
url - The URL which contains the graphic content.
bis - The reusable input stream containing the bytes from url.
Returns:
The newly-created Graphic instance, or null if this factory was unable to create such an instance.
Throws:
IOException - For IO errors.


Copyright © 2017. All rights reserved.