org.apache.xmlgraphics.image.loader.impl
Class AbstractImagePreloader
java.lang.Object
org.apache.xmlgraphics.image.loader.impl.AbstractImagePreloader
- All Implemented Interfaces:
- ImagePreloader
- Direct Known Subclasses:
- PreloaderBMP, PreloaderEMF, PreloaderEPS, PreloaderGIF, PreloaderImageIO, PreloaderJPEG, PreloaderTIFF
public abstract class AbstractImagePreloader
- extends Object
- implements ImagePreloader
Abstract base class for image preloaders. It provides helper methods for often-used tasks.
Method Summary |
protected byte[] |
getHeader(ImageInputStream in,
int size)
Allows to read an image header (usually just a magic number). |
int |
getPriority()
Returns the priority of the preloader. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractImagePreloader
public AbstractImagePreloader()
getHeader
protected byte[] getHeader(ImageInputStream in,
int size)
throws IOException
- Allows to read an image header (usually just a magic number). The InputStream is reset
to the position before the header was read.
- Parameters:
in
- the ImageInputStream to read fromsize
- the size of the header
- Returns:
- the loaded header
- Throws:
IOException
- if an I/O error occurs while reading the header
getPriority
public int getPriority()
- Returns the priority of the preloader. The lower the value, the higher the preloader's
priority.
- Specified by:
getPriority
in interface ImagePreloader
- Returns:
- an integer (default is 1000)
Copyright 1999-2012 The Apache Software Foundation. All Rights Reserved.