On 6/10/2014 3:35 PM, Ray Morris wrote:
When attempting to read and display XML metadata, how can I test whether any such data exists? I am using code that I got from the Internet and it reads the XML metadata into a byte array. I tried testing << if (array.length == 0 ) but got a "java.lang.NullPointerException" error.

This isn't really an iText question, it's a pure Java question.
If the value of array is null, then it's normal you get a NullPointerException when you ask this null object for its length.
You should do something like this:

if (array == null || array.length == 0) {
    // there is no XMP in this file
}
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to