Package org.apache.commons.imaging.formats.jpeg.decoder

# Class JpegDecoder

java.lang.Object
org.apache.commons.imaging.common.BinaryFileParser
org.apache.commons.imaging.formats.jpeg.decoder.JpegDecoder

All Implemented Interfaces:
  `JpegUtils.Visitor`

public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `JpegDecoder()`
  Constructs a new instance with the default, big-endian, byte order.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `beginSos()`
  `BufferedImage`
  `decode(ByteSource byteSource)`
  `void`
  `setTiffRgb()`
  Sets the decoder to treat incoming data as using the RGB color model.
  `boolean`
  `visitSegment(int marker, byte[] markerBytes, int segmentLength, byte[] segmentLengthBytes, byte[] segmentData)`
  `void`
  `visitSos(int marker, byte[] markerBytes, byte[] imageData)`

  ### Methods inherited from class org.apache.commons.imaging.common.BinaryFileParser

  `debugNumber, debugNumber, getByteOrder, setByteOrder`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### JpegDecoder

    public JpegDecoder()
    Constructs a new instance with the default, big-endian, byte order.

- ## Method Details

  - ### beginSos

    public boolean beginSos()
    Specified by:
      `beginSos` in interface `JpegUtils.Visitor`

  - ### decode

    public BufferedImage decode(ByteSource byteSource) throws IOException, ImagingException
    Throws:
      `IOException`
      `ImagingException`

  - ### setTiffRgb

    public void setTiffRgb()
    Sets the decoder to treat incoming data as using the RGB color model. This extension to the JPEG specification is intended to support TIFF files that use JPEG compression.

  - ### visitSegment

    public boolean visitSegment(int marker, byte[] markerBytes, int segmentLength, byte[] segmentLengthBytes, byte[] segmentData) throws ImagingException, IOException
    Specified by:
      `visitSegment` in interface `JpegUtils.Visitor`
    Throws:
      `ImagingException`
      `IOException`

  - ### visitSos

    public void visitSos(int marker, byte[] markerBytes, byte[] imageData)
    Specified by:
      `visitSos` in interface `JpegUtils.Visitor`