java.lang.Object
org.jpo.cache.ImageBytes
- All Implemented Interfaces:
Serializable
Serializable array of bytes representing an Image
- See Also:
-
Constructor Summary
ConstructorDescriptionImageBytes
(byte[] bytes) Constructs a new ImageBytes object with the key and the bytes as read from disk -
Method Summary
Modifier and TypeMethodDescriptionReturns the image bytes from the stored bytesbyte[]
getBytes()
Returns the image bytes from the stored bytes arrayReturns the last modification time of the data that was stored in the byte arrayboolean
Can be queried to see if the image came from the cache or was loaded from diskvoid
setLastModification
(FileTime lastModification) Remembers the last modification time of the source filevoid
setRetrievedFromCache
(boolean retrievedFromCache) Sets the retrievedFromCache flag.
-
Constructor Details
-
ImageBytes
public ImageBytes(byte[] bytes) Constructs a new ImageBytes object with the key and the bytes as read from disk- Parameters:
bytes
- the bytes
-
-
Method Details
-
isRetrievedFromCache
public boolean isRetrievedFromCache()Can be queried to see if the image came from the cache or was loaded from disk- Returns:
- true if retrieved from cache
-
setRetrievedFromCache
public void setRetrievedFromCache(boolean retrievedFromCache) Sets the retrievedFromCache flag.- Parameters:
retrievedFromCache
- the new value for the flag
-
getByteArrayInputStream
Returns the image bytes from the stored bytes- Returns:
- the bytes as a ByteArrayInputStream
-
getBytes
public byte[] getBytes()Returns the image bytes from the stored bytes array- Returns:
- the bytes[]
-
setLastModification
Remembers the last modification time of the source file- Parameters:
lastModification
- the last modification time
-
getLastModification
Returns the last modification time of the data that was stored in the byte array- Returns:
- the last modification time
-