Class XMPScanner
java.lang.Object
com.twelvemonkeys.imageio.metadata.xmp.XMPScanner
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic void
static Reader
scanForXMPPacket
(Object pInput) Scans the given input for an XML metadata packet.
-
Constructor Details
-
XMPScanner
public XMPScanner()
-
-
Method Details
-
scanForXMPPacket
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 anImageInputStream
or any object that can be passed toImageIO.createImageInputStream(Object)
. Typically this may be aFile
,InputStream
orRandomAccessFile
.- 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 frompInput
.- See Also:
-
main
- Throws:
IOException
-