com.drew.metadata.jpeg
Class JpegCommentReader

java.lang.Object
  extended by com.drew.metadata.jpeg.JpegCommentReader
All Implemented Interfaces:
MetadataReader

public class JpegCommentReader
extends Object
implements MetadataReader

Decodes the comment stored within Jpeg files, populating a Metadata object with tag values in a JpegCommentDirectory.

Author:
Drew Noakes http://drewnoakes.com

Field Summary
private  byte[] _data
          The COM data segment.
 
Constructor Summary
JpegCommentReader(byte[] data)
          Creates a JpegCommentReader for raw JPEG data.
JpegCommentReader(File jpegFile)
          Creates a new JpegReader for the specified Jpeg jpegFile.
JpegCommentReader(InputStream is)
          Creates a JpegCommentReader for a JPEG stream.
 
Method Summary
 Metadata extract()
          Performs the Jpeg data extraction, returning a new instance of Metadata.
 Metadata extract(Metadata metadata)
          Performs the Jpeg data extraction, adding found values to the specified instance of Metadata.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_data

private final byte[] _data
The COM data segment.

Constructor Detail

JpegCommentReader

public JpegCommentReader(File jpegFile)
                  throws JpegProcessingException
Creates a new JpegReader for the specified Jpeg jpegFile.

Throws:
JpegProcessingException

JpegCommentReader

public JpegCommentReader(InputStream is)
                  throws JpegProcessingException
Creates a JpegCommentReader for a JPEG stream.

Parameters:
is - JPEG stream. Stream will be closed.
Throws:
JpegProcessingException

JpegCommentReader

public JpegCommentReader(byte[] data)
Creates a JpegCommentReader for raw JPEG data.

Parameters:
data - JPEG data as a byte[].
Method Detail

extract

public Metadata extract()
Performs the Jpeg data extraction, returning a new instance of Metadata.

Specified by:
extract in interface MetadataReader
Returns:
The populated Metadata object.

extract

public Metadata extract(Metadata metadata)
Performs the Jpeg data extraction, adding found values to the specified instance of Metadata.

Specified by:
extract in interface MetadataReader
Returns:
The updated Metadata object.