Package org.htmlunit.platform.image
Class ImageIOImageData
java.lang.Object
org.htmlunit.platform.image.ImageIOImageData
- All Implemented Interfaces:
AutoCloseable
,ImageData
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Wraps the ImageReader for an HtmlImage. This is necessary because an object with a finalize() method is only garbage collected after the method has been run. Which causes all referenced objects to also not be garbage collected until this happens. Because a HtmlImage references a lot of objects which could all be garbage collected without impacting the ImageReader it is better to wrap it in another class.
Wraps the ImageReader for an HtmlImage. This is necessary because an object with a finalize() method is only garbage collected after the method has been run. Which causes all referenced objects to also not be garbage collected until this happens. Because a HtmlImage references a lot of objects which could all be garbage collected without impacting the ImageReader it is better to wrap it in another class.
-
Field Details
-
imageReader_
-
-
Constructor Details
-
ImageIOImageData
- Throws:
IOException
-
-
Method Details
-
getImageReader
- Returns:
- the
ImageReader
-
getWidthHeight
- Specified by:
getWidthHeight
in interfaceImageData
- Throws:
IOException
-
finalize
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-