Class BufferedImageCacheEntry
java.lang.Object
org.openstreetmap.josm.data.cache.CacheEntry
org.openstreetmap.josm.data.cache.BufferedImageCacheEntry
- All Implemented Interfaces:
Serializable
Cache Entry that has methods to get the BufferedImage, that will be cached along in memory
but will be not serialized when saved to the disk (to avoid duplication of data)
- See Also:
-
Field Summary
FieldsFields inherited from class org.openstreetmap.josm.data.cache.CacheEntry
content -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetImage()Returns BufferedImage from for the content.static BufferedImageCacheEntrypngEncoded(BufferedImage img) Encodes the given image as PNG and returns a cache entryprivate voidMethods inherited from class org.openstreetmap.josm.data.cache.CacheEntry
getContent
-
Field Details
-
serialVersionUID
- See Also:
-
img
-
imageLoaded
-
-
Constructor Details
-
BufferedImageCacheEntry
- Parameters:
content- byte array containing image
-
-
Method Details
-
pngEncoded
Encodes the given image as PNG and returns a cache entry- Parameters:
img- the image- Returns:
- a cache entry for the PNG encoded image
- Throws:
UncheckedIOException- if an I/O error occurs
-
getImage
Returns BufferedImage from for the content. Subsequent calls will return the same instance, to reduce overhead of ImageIO- Returns:
- BufferedImage of cache entry content
- Throws:
IOException- if an error occurs during reading.
-
writeObject
- Throws:
IOException
-