Package com.iizix.image
Class CachedImage
java.lang.Object
com.iizix.image.CachedImage
The cached image class contains a loaded image in memory and can be used to perform various operations on it.
- Author:
- Christopher Mindus
- Constructor SummaryConstructors
- Method SummaryModifier and TypeMethodDescriptionGets the buffered image.- byte[]- getData()Gets a copy of the original (file) data.Gets the file extension.Gets the original file name.
- Constructor Details- CachedImageLoads an image from a File.- An error is logged in the server in case of an exception not being a direct - {@link IOException}.- Parameters:
- file- The file.
- keepFileData- Flag to keep the original file data (please note that this requires more memory).
- Throws:
- FileNotFoundException- If the file is not found.
- IOException- For I/O errors (could also wrap e.g. OutOfMemoryError or other exceptions).
 
 
- Method Details- getBufferedImageGets the buffered image.- Returns:
- The buffered image.
 
- getFileNameGets the original file name.- Returns:
- The original file name can be a canonical file name as well as a "fake" file name where only the file extension should be checked.
 
- getFileExtensionGets the file extension.- Returns:
- The file extension without the "dot", nullif none is found.
 
- getDatapublic byte[] getData()Gets a copy of the original (file) data.- Returns:
- The byte array, or nullin case of an OutOfMemoryException or that the file data is not kept in this instance. An error is logged in the server in case of a problem.