Interface StreamRegistryEntry

    • Method Detail

      • getReadlimit

        int getReadlimit()
        returns the number of bytes that need to be supported by mark on the InputStream for this to check the stream for compatibility.
      • isCompatibleStream

        boolean isCompatibleStream​(java.io.InputStream is)
                            throws java.io.StreamCorruptedException
        Check if the Stream references an image that can be handled by this format handler. The input stream passed in should be assumed to support mark and reset. If this method throws a StreamCorruptedException then the InputStream will be closed and a new one opened (if possible). This method should only throw a StreamCorruptedException if it is unable to restore the state of the InputStream (i.e. mark/reset fails basically).
        Throws:
        java.io.StreamCorruptedException
      • handleStream

        Filter handleStream​(java.io.InputStream is,
                            ParsedURL origURL,
                            boolean needRawData)
        Decode the Stream into a Filter. If the stream turns out not to be of a format this RegistryEntry can handle you should attempt to reset the stream, then return null.

        This should only return a broken link image when the image is clearly of this format, but is unreadable for some reason.

        Parameters:
        is - The input stream that contains the image.
        origURL - The original URL, if any, for documentation purposes only. This may be null.
        needRawData - If true the image returned should not have any default color correction the file may specify applied.