## javax.media.jai.tilecodec
Class TileEncoderImpl

    java.lang.Object
      |
      +--javax.media.jai.tilecodec.TileEncoderImpl

All Implemented Interfaces:
  TileEncoder

public abstract class TileEncoderImpl
extends java.lang.Object
implements TileEncoder

A partial implementation of the `TileEncoder` interface useful for subclassing.

Since:
  1.1

Field Summary
`protected java.lang.String` `formatName` The name of the format.
`protected java.io.OutputStream` `outputStream` The `OutputStream` to write the encoded data to.
`protected TileCodecParameterList` `paramList` The `TileCodecParameterList` object containing the encoding parameters.

Constructor Summary
`TileEncoderImpl(java.lang.String formatName, java.io.OutputStream output, TileCodecParameterList param)` Constructs an `TileEncoderImpl`.

Method Summary
`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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface javax.media.jai.tilecodec.TileEncoder
`encode`

Field Detail

### formatName

    protected java.lang.String formatName

  The name of the format.

### outputStream

    protected java.io.OutputStream outputStream

  The `OutputStream` to write the encoded data to.

### paramList

    protected TileCodecParameterList paramList

  The `TileCodecParameterList` object containing the encoding parameters.

Constructor Detail

### TileEncoderImpl

    public TileEncoderImpl(java.lang.String formatName,
                           java.io.OutputStream output,
                           TileCodecParameterList param)

  Constructs an `TileEncoderImpl`. An `IllegalArgumentException` will be thrown if `param`'s `getParameterListDescriptor()` method does not return the same descriptor as that from the associated `TileCodecDescriptor`'s `getParameterListDescriptor` method for the "tileEncoder" registry mode.

  If param is null, then the default parameter list for encoding as defined by the associated `TileCodecDescriptor`'s `getDefaultParameters()` method will be used for encoding. If this too is null, an `IllegalArgumentException` will be thrown if the `ParameterListDescriptor` associated with the associated `TileCodecDescriptor` for the "tileEncoder" registry mode, reports that the number of parameters for this format is non-zero.

  Parameters:
    `formatName` - The name of the format.
    `output` - The `OutputStream` to write encoded data to.
    `param` - The object containing the tile encoding parameters.
  Throws:
    `java.lang.IllegalArgumentException` - if formatName is null.
    `java.lang.IllegalArgumentException` - if output is null.
    `java.lang.IllegalArgumentException` - if param's getFormatName() method does not return the same formatName as the one specified to this method.
    `java.lang.IllegalArgumentException` - if the ParameterListDescriptors associated with the param and the associated TileCodecDescriptor are not equal.
    `java.lang.IllegalArgumentException` - if param does not have "tileEncoder" as one of the valid modes that it supports.

Method Detail

### getFormatName

    public java.lang.String getFormatName()

  Returns the format name of the encoding scheme.
  Specified by:
    `getFormatName` in interface `TileEncoder`

### getEncodeParameterList

    public TileCodecParameterList getEncodeParameterList()

  Returns the current parameters as an instance of the `TileCodecParameterList` interface.
  Specified by:
    `getEncodeParameterList` in interface `TileEncoder`

### getOutputStream

    public java.io.OutputStream getOutputStream()

  Returns the `OutputStream` to which the encoded data will be written.
  Specified by:
    `getOutputStream` in interface `TileEncoder`