public void listImages(int nrOfCalls) throws IOException {
List images = this.imageDatabase.getImages();
StopWatch stopWatch = new StopWatch();
for (Iterator it = images.iterator(); it.hasNext();) {
ImageDescriptor image = (ImageDescriptor) it.next();
stopWatch.start(image.getName());
ByteArrayOutputStream os = null;
for (int i = 0; i < nrOfCalls; i++) {
os = new ByteArrayOutputStream();
this.imageDatabase.streamImage(image.getName(), os);
}
stopWatch.stop();
System.out.println("Found image '" + image.getName() + "' with content size " + os.size() +
" and description length " + image.getDescriptionLength());
}
System.out.println(stopWatch.prettyPrint());
}