for (int i = 0; i< formats.size(); i++) {
Class clazz = (Class)formats.get(i);
try {
reader = (ImageReader)clazz.newInstance();
} catch (Exception e) {
throw new FopImageException("ImageReader implementation cannot be instantiated: "+e.getMessage());
}
if (reader.verifySignature(uri, bis)) {
return reader;
}
}
} catch (IOException ex) {
throw new FopImageException(ex.getMessage());
}
return null;
}