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
,PreloaderRawPNG
,PreloaderTIFF
Abstract base class for image preloaders. It provides helper methods for often-used tasks.
-
Field Summary
Fields inherited from interface org.apache.xmlgraphics.image.loader.spi.ImagePreloader
DEFAULT_PRIORITY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]
getHeader
(ImageInputStream in, int size) Allows to read an image header (usually just a magic number).int
Returns the priority of the preloader.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.xmlgraphics.image.loader.spi.ImagePreloader
preloadImage
-
Constructor Details
-
AbstractImagePreloader
public AbstractImagePreloader()
-
-
Method Details
-
getHeader
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 interfaceImagePreloader
- Returns:
- an integer (default is 1000)
-