Class ImageSource

  • All Implemented Interfaces:
    javax.xml.transform.Source

    public class ImageSource
    extends java.lang.Object
    implements javax.xml.transform.Source
    Acts as a holder for the input to image loading operations.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean fastSource  
      private javax.imageio.stream.ImageInputStream iin  
      private java.lang.String systemId  
    • Constructor Summary

      Constructors 
      Constructor Description
      ImageSource​(javax.imageio.stream.ImageInputStream in, java.lang.String systemId, boolean fastSource)
      Main constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.imageio.stream.ImageInputStream getImageInputStream()
      Returns the ImageInputStream.
      java.io.InputStream getInputStream()
      Returns an InputStream which operates on the underlying ImageInputStream.
      java.lang.String getSystemId()
      boolean isFastSource()
      Indicates whether this ImageSource is a fast source, i.e.
      void setImageInputStream​(javax.imageio.stream.ImageInputStream in)
      Sets the ImageInputStream.
      void setSystemId​(java.lang.String systemId)
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface javax.xml.transform.Source

        isEmpty
    • Field Detail

      • systemId

        private java.lang.String systemId
      • iin

        private javax.imageio.stream.ImageInputStream iin
      • fastSource

        private boolean fastSource
    • Constructor Detail

      • ImageSource

        public ImageSource​(javax.imageio.stream.ImageInputStream in,
                           java.lang.String systemId,
                           boolean fastSource)
        Main constructor.
        Parameters:
        in - the ImageInputStream to load from
        systemId - the system identifier (resolved URI) of the image
        fastSource - true if it's a fast source (accessing local files)
    • Method Detail

      • getInputStream

        public java.io.InputStream getInputStream()
        Returns an InputStream which operates on the underlying ImageInputStream.
        Returns:
        the InputStream or null if the stream has been closed
      • getImageInputStream

        public javax.imageio.stream.ImageInputStream getImageInputStream()
        Returns the ImageInputStream.
        Returns:
        the ImageInputStream or null if the stream has been closed
      • setImageInputStream

        public void setImageInputStream​(javax.imageio.stream.ImageInputStream in)
        Sets the ImageInputStream.
        Parameters:
        in - the ImageInputStream
      • getSystemId

        public java.lang.String getSystemId()
        Specified by:
        getSystemId in interface javax.xml.transform.Source
      • setSystemId

        public void setSystemId​(java.lang.String systemId)
        Specified by:
        setSystemId in interface javax.xml.transform.Source
      • isFastSource

        public boolean isFastSource()
        Indicates whether this ImageSource is a fast source, i.e. accesses local files rather than network resources.
        Returns:
        true if it's a fast source
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object