Class XMPScanner


  • public final class XMPScanner
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      XMPScanner()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String[] pArgs)  
      static java.io.Reader scanForXMPPacket​(java.lang.Object pInput)
      Scans the given input for an XML metadata packet.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • XMPScanner

        public XMPScanner()
    • Method Detail

      • scanForXMPPacket

        public static java.io.Reader scanForXMPPacket​(java.lang.Object pInput)
                                               throws java.io.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:
        java.nio.charset.UnsupportedCharsetException - if the encoding specified within the BOM is not supported by the JRE.
        java.io.IOException - if an I/O exception occurs reading from pInput.
        See Also:
        ImageIO.createImageInputStream(Object)
      • main

        public static void main​(java.lang.String[] pArgs)
                         throws java.io.IOException
        Throws:
        java.io.IOException