org.apache.xmlgraphics.image.loader

## Class ImageSource

- java.lang.Object
- - org.apache.xmlgraphics.image.loader.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.

- - ### Constructor Summary

    Constructors
    Constructor and 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 and 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`

- - ### 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`

Copyright 1999-2025 The Apache Software Foundation. All Rights Reserved.