Class ImageIOImageData

  • All Implemented Interfaces:
    java.lang.AutoCloseable, ImageData

    public class ImageIOImageData
    extends java.lang.Object
    implements 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.
    • Field Detail

      • imageReader_

        private final javax.imageio.ImageReader imageReader_
    • Constructor Detail

      • ImageIOImageData

        public ImageIOImageData​(java.io.InputStream inputStream)
                         throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • getImageReader

        public javax.imageio.ImageReader getImageReader()
        Returns:
        the ImageReader
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.io.IOException