javax.media.jai.tilecodec
Interface TileDecoderFactory


public interface TileDecoderFactory

A factory for creating TileDecoders.

This class stipulates that the capabilities of the TileDecoder be specified by implementing the getDecodingCapability() method.

Since:
JAI 1.1
See Also:
NegotiableCapability

Method Summary
 TileDecoder createDecoder(InputStream input, TileCodecParameterList param)
          Creates a TileDecoder capable of decoding the encoded data from the given InputStream using the specified TileCodecParameterList containing the decoding parameters to be used.
 NegotiableCapability getDecodeCapability()
          Returns the capabilities of this TileDecoder as a NegotiableCapability.
 

Method Detail

createDecoder

public TileDecoder createDecoder(InputStream input,
                                 TileCodecParameterList param)
Creates a TileDecoder capable of decoding the encoded data from the given InputStream using the specified TileCodecParameterList containing the decoding parameters to be used.

This method can return null if the TileDecoder is not capable of producing output for the given set of parameters. For example, if a TileDecoder is only capable of dealing with a jpeg quality factor of 0.5, and the associated TileCodecParameterList specifies a quality factor of 0.75, null should be returned.

It is recommended that the data in the supplied InputStream not be used as a factor in determining whether this InputStream can be successfully decoded, unless the supplied InputStream is known to be rewindable (i.e. its markSupported() method returns true or it has additional functionality that allows backward seeking). It is required that the InputStream contain the same data on returning from this method as before this method was called. In other words, the InputStream should only be used as a discriminator if it can be rewound to its starting position before returning from this method. Note that wrapping the incoming InputStream in a PushbackInputStream and then rewinding the PushbackInputStream before returning does not rewind the wrapped InputStream.

If the supplied TileCodecParameterList is null, a default TileCodecParameterList from the TileCodecDescriptor will be used to create the decoder.

Exceptions thrown by the TileDecoder will be caught by this method and will not be propagated.

Parameters:
input - The InputStream containing the encoded data to decode.
param - The parameters to be be used in the decoding process.
Throws:
IllegalArgumentException - if input is null.

getDecodeCapability

public NegotiableCapability getDecodeCapability()
Returns the capabilities of this TileDecoder as a NegotiableCapability.

See Also:
NegotiableCapability