org.apache.batik.ext.awt.image.spi

Interface StreamRegistryEntry

public interface StreamRegistryEntry extends RegistryEntry

This type of Image tag registy entry is used for most normal image file formats. You are given a markable stream and an opportunity to check if it is "compatible" if you return true then you will likely be asked to provide the decoded image next.

See Also:

Method Summary
intgetReadlimit()
returns the number of bytes that need to be supported by mark on the InputStream for this to check the stream for compatibility.
FilterhandleStream(InputStream is, ParsedURL origURL, boolean needRawData)
Decode the Stream into a Filter.
booleanisCompatibleStream(InputStream is)
Check if the Stream references an image that can be handled by this format handler.

Method Detail

getReadlimit

public 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.

handleStream

public Filter handleStream(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.

isCompatibleStream

public boolean isCompatibleStream(InputStream is)
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).
Copyright B) 2007 Apache Software Foundation. All Rights Reserved.