Package rife.cmf.loader.image
Class ImageIOLoader
java.lang.Object
rife.cmf.loader.ImageContentLoaderBackend
rife.cmf.loader.image.ImageIOLoader
- All Implemented Interfaces:
ContentLoaderBackend<Image>
This is an image loader back-end that uses ImageIO to load image files.
- Since:
- 1.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether the back-end is present.loadFromBytes
(byte[] data, Set<String> errors) Loads the data from a byte array.Methods inherited from class rife.cmf.loader.ImageContentLoaderBackend
load
-
Constructor Details
-
ImageIOLoader
public ImageIOLoader()
-
-
Method Details
-
loadFromBytes
public LoadedContent<Image> loadFromBytes(byte[] data, Set<String> errors) throws ContentManagerException Description copied from class:ImageContentLoaderBackend
Loads the data from a byte array.- Specified by:
loadFromBytes
in classImageContentLoaderBackend
- Parameters:
data
- the raw data that has to be loadederrors
- a set to which possible error messages will be added- Returns:
- an instance of the
LoadedContent
withImage
data; ornull
if the raw data couldn't be loaded - Throws:
ContentManagerException
-
isBackendPresent
public boolean isBackendPresent()Description copied from interface:ContentLoaderBackend
Indicates whether the back-end is present.This can be important for optional libraries that should only actually try to load the data when the required classes are available in the classpath.
- Returns:
true
if the back-end is present; orfalse
if this is not the case
-