## org.jfree.chart.encoders
Class SunJPEGEncoderAdapter

    java.lang.Object
      org.jfree.chart.encoders.SunJPEGEncoderAdapter

All Implemented Interfaces:
  ImageEncoder

    public class SunJPEGEncoderAdapter

extends java.lang.Object
implements ImageEncoder

Adapter class for the Sun JPEG Encoder.

Author:
  Richard Atkinson

Constructor Summary
`SunJPEGEncoderAdapter()` Default constructor.

Method Summary
`byte[]` `encode(java.awt.image.BufferedImage bufferedImage)` Encodes an image in JPEG format.
`void` `encode(java.awt.image.BufferedImage bufferedImage, java.io.OutputStream outputStream)` Encodes an image in JPEG format and writes it to an OutputStream.
`float` `getQuality()` Get the quality of the image encoding.
`boolean` `isEncodingAlpha()` Get whether the encoder encodes alpha transparency (always false).
`void` `setEncodingAlpha(boolean encodingAlpha)` Set whether the encoder should encode alpha transparency (not supported for JPEG).
`void` `setQuality(float quality)` Set the quality of the image encoding (supported).

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

Constructor Detail

### SunJPEGEncoderAdapter

    public SunJPEGEncoderAdapter()

  Default constructor.

Method Detail

### getQuality

    public float getQuality()

  Get the quality of the image encoding.

  Specified by:
    `getQuality` in interface `ImageEncoder`
  Returns:
    A float representing the quality.

### setQuality

    public void setQuality(float quality)

  Set the quality of the image encoding (supported).

  Specified by:
    `setQuality` in interface `ImageEncoder`
  Parameters:
    `quality` - A float representing the quality.

### isEncodingAlpha

    public boolean isEncodingAlpha()

  Get whether the encoder encodes alpha transparency (always false).

  Specified by:
    `isEncodingAlpha` in interface `ImageEncoder`
  Returns:
    Whether the encoder is encoding alpha transparency.

### setEncodingAlpha

    public void setEncodingAlpha(boolean encodingAlpha)

  Set whether the encoder should encode alpha transparency (not supported for JPEG).

  Specified by:
    `setEncodingAlpha` in interface `ImageEncoder`
  Parameters:
    `encodingAlpha` - Whether the encoder should encode alpha transparency.

### encode

    public byte[] encode(java.awt.image.BufferedImage bufferedImage)
                  throws java.io.IOException

  Encodes an image in JPEG format.

  Specified by:
    `encode` in interface `ImageEncoder`
  Parameters:
    `bufferedImage` - The image to be encoded.
  Returns:
    The byte[] that is the encoded image.
  Throws:
    `java.io.IOException`

### encode

    public void encode(java.awt.image.BufferedImage bufferedImage,
                       java.io.OutputStream outputStream)
                throws java.io.IOException

  Encodes an image in JPEG format and writes it to an OutputStream.

  Specified by:
    `encode` in interface `ImageEncoder`
  Parameters:
    `bufferedImage` - The image to be encoded.
    `outputStream` - The OutputStream to write the encoded image to.
  Throws:
    `java.io.IOException`