Class XMPScanner

java.lang.Object
com.twelvemonkeys.imageio.metadata.xmp.XMPScanner

public final class XMPScanner extends Object
XMPScanner
Version:
$Id: XMPScanner.java,v 1.0 Nov 11, 2009 4:49:00 PM haraldk Exp$
Author:
Harald Kuhr, last modified by $Author: haraldk$
  • Constructor Details

    • XMPScanner

      public XMPScanner()
  • Method Details

    • scanForXMPPacket

      public static Reader scanForXMPPacket(Object pInput) throws IOException
      Scans the given input for an XML metadata packet. The scanning process involves reading every byte in the file, while searching for an XMP packet. This process is very inefficient, compared to reading a known file format.

      NOTE: The XMP Specification says this method of reading an XMP packet should be considered a last resort.
      This is because files may contain multiple XMP packets, some which may be related to embedded resources, some which may be obsolete (or even incomplete).

      Parameters:
      pInput - the input to scan. The input may be an ImageInputStream or any object that can be passed to ImageIO.createImageInputStream(Object). Typically this may be a File, InputStream or RandomAccessFile.
      Returns:
      a character Reader
      Throws:
      UnsupportedCharsetException - if the encoding specified within the BOM is not supported by the JRE.
      IOException - if an I/O exception occurs reading from pInput.
      See Also:
    • main

      public static void main(String[] pArgs) throws IOException
      Throws:
      IOException