## javax.media.jai.tilecodec
Interface TileEncoder

All Known Implementing Classes:
  TileEncoderImpl

public interface TileEncoder

An interface describing objects that transform a `Raster` into an `OutputStream`. If the `TileCodecDescriptor` for this format returns true from its `includesSampleModelInfo()` and `includesLocationInfo()` methods, then the encoder must encode this information in the encoded tiles. If these methods return false, then this information (needed to create a `Raster` on decoding) must be provided to the `TileDecoder` by setting the `SampleModel` on the `TileCodecParameterList` supplied to the `TileDecoder` and supplying the tile upper left corner location to the `TileDecoder` via the `TileDecoder`'s `decode(Point location)` method. The `SampleModel` value set on the `TileCodecParameterList` for the `TileDecoder` should be the same as that of the `Raster` to be encoded, in order to get a `Raster` on decoding that is equivalent to the one being encoded.

Since:
  1.1
See Also:
  `TileCodecDescriptor`, `TileDecoder`

Method Summary
`void` `encode(java.awt.image.Raster ras)` Encodes a `Raster` and writes the output to the `OutputStream` associated with this `TileEncoder`.
`TileCodecParameterList` `getEncodeParameterList()` Returns the current parameters as an instance of the `TileCodecParameterList` interface.
`java.lang.String` `getFormatName()` Returns the format name of the encoding scheme.
`java.io.OutputStream` `getOutputStream()` Returns the `OutputStream` to which the encoded data will be written.

Method Detail

### getFormatName

    public java.lang.String getFormatName()

  Returns the format name of the encoding scheme.

### getEncodeParameterList

    public TileCodecParameterList getEncodeParameterList()

  Returns the current parameters as an instance of the `TileCodecParameterList` interface.

### getOutputStream

    public java.io.OutputStream getOutputStream()

  Returns the `OutputStream` to which the encoded data will be written.

### encode

    public void encode(java.awt.image.Raster ras)
                throws java.io.IOException

  Encodes a `Raster` and writes the output to the `OutputStream` associated with this `TileEncoder`.
  Parameters:
    `ras` - the `Raster` to encode.
  Throws:
    `java.io.IOException` - if an I/O error occurs while writing to the OutputStream.
    `java.lang.IllegalArgumentException` - if ras is null.