## javax.media.jai.tilecodec
Interface TileEncoderFactory

public interface TileEncoderFactory

A factory for creating `TileEncoder`s.

This class stipulates that the capabilities of the `TileEncoder` be specified by implementing the `getEncodingCapability()` method.

Since:
  1.1
See Also:
  `NegotiableCapability`

Method Summary
`TileEncoder` `createEncoder(java.io.OutputStream output, TileCodecParameterList paramList, java.awt.image.SampleModel sampleModel)` Creates a `TileEncoder` capable of encoding a `Raster` with the specified `SampleModel` using the encoding parameters specified via the `TileCodecParameterList`, to the given `OutputStream`.
`NegotiableCapability` `getEncodeCapability()` Returns the capabilities of this `TileEncoder` as a `NegotiableCapability`.

Method Detail

### createEncoder

    public TileEncoder createEncoder(java.io.OutputStream output,
                                     TileCodecParameterList paramList,
                                     java.awt.image.SampleModel sampleModel)

  Creates a `TileEncoder` capable of encoding a `Raster` with the specified `SampleModel` using the encoding parameters specified via the `TileCodecParameterList`, to the given `OutputStream`.

  This method can return null if the `TileEncoder` is not capable of producing output for the given set of parameters. For example, if a `TileEncoder` is only capable of dealing with a `PixelInterleavedSampleModel`, and the supplied `SampleModel` is not an instance of `PixelInterleavedSampleModel`, null should be returned. The supplied `SampleModel` should be used to decide whether it can be encoded by this class, and is not needed to actually construct a `TileEncoder`.

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

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

  Parameters:
    `output` - The `OutputStream` to write the encoded data to.
    `paramList` - The `TileCodecParameterList` containing the encoding parameters.
    `sampleModel` - The `SampleModel` of the `Raster` to be encoded.
  Throws:
    `java.lang.IllegalArgumentException` - if output is null.
    `java.lang.IllegalArgumentException` - if sampleModel is null.

### getEncodeCapability

    public NegotiableCapability getEncodeCapability()

  Returns the capabilities of this `TileEncoder` as a `NegotiableCapability`.
  See Also:
    `NegotiableCapability`