Package net.sourceforge.jiu.codecs.jpeg

# Class JPEGMarkerReader

java.lang.Object
net.sourceforge.jiu.codecs.jpeg.JPEGMarkerReader

public class JPEGMarkerReader extends Object
Static helper methods to read various JPEG bitstream headers from a `DataInput` source into objects of the appropriate data classes. Objects are then added to a `JPEGData` object.

Since:
  0.14.0
Author:
  Marco Schmidt

## Constructor Summary

Constructors
Modifier
Constructor
Description
`private`
`JPEGMarkerReader()`
Private constructor to prevent instantiation.

## Method Summary

Modifier and Type
Method
Description
`static void`
`readHuffmanTables(DataInput in, JPEGData jpegData, int length)`
`static void`
`readQuantizationTables(DataInput in, JPEGData jpegData, int length)`
Read quantization tables from a DQT marker.
`static void`
`readStartOfFrame(DataInput in, JPEGData jpegData, int marker, int length)`
`static void`
`readStartOfScan(DataInput in, JPEGData jpegData, int length)`
Read an SOS (start of scan) marker.

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

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

## Constructor Details

### JPEGMarkerReader

private JPEGMarkerReader()
Private constructor to prevent instantiation.

## Method Details

### readHuffmanTables

public static void readHuffmanTables(DataInput in, JPEGData jpegData, int length) throws InvalidFileStructureException, IOException

Throws:
  `InvalidFileStructureException`
  `IOException`

### readQuantizationTables

public static void readQuantizationTables(DataInput in, JPEGData jpegData, int length) throws InvalidFileStructureException, IOException
Read quantization tables from a DQT marker. Pinvalid input: '&M' 7.8.3, p. 118f.

Parameters:
  `jpegData` - data object which will store the table(s)
  `length` - length of marker
Throws:
  `InvalidFileStructureException` - if the DQT contains invalid data
  `IOException` - on reading errors

### readStartOfFrame

public static void readStartOfFrame(DataInput in, JPEGData jpegData, int marker, int length) throws InvalidFileStructureException, IOException, UnsupportedTypeException

Throws:
  `InvalidFileStructureException`
  `IOException`
  `UnsupportedTypeException`

### readStartOfScan

public static void readStartOfScan(DataInput in, JPEGData jpegData, int length) throws InvalidFileStructureException, IOException, UnsupportedTypeException
Read an SOS (start of scan) marker. Pinvalid input: '&M' 7.6, p. 113.

Parameters:
  `in` - source to read marker information from
  `jpegData` - `JPEGData` object to update with information from the marker
  `length` - size of marker in bytes
Throws:
  `InvalidFileStructureException` - if encountered data does not follow the JPEG standard
  `IOException` - on I/O errors
  `UnsupportedTypeException` - if encountered data is valid but unsupported by this package