com.jrefinery.report.util
Class ImageComparator

java.lang.Object
  extended bycom.jrefinery.report.util.ImageComparator

public class ImageComparator
extends java.lang.Object

The ImageComparator tries to compare a byte[] for equality by creating 2 hashes for the bytearray and comparing thoose hashes. If no digest algorithms are available, then the complete byte[] is used for comparison.

Author:
Thomas Morgner

Constructor Summary
ImageComparator()
          Creates a new ImageComparator.
 
Method Summary
 com.jrefinery.report.util.ImageComparator.ImageCompareData createCompareData(byte[] image)
          Creates 2 comparable objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageComparator

public ImageComparator()
Creates a new ImageComparator. The comparator checks whether the MD5 and the SHA message digest implementations are available. If they are not available, an alternative comparison method is used, which is more memory consuming.

Method Detail

createCompareData

public com.jrefinery.report.util.ImageComparator.ImageCompareData createCompareData(byte[] image)
Creates 2 comparable objects. These objects can be compared for equality.

Parameters:
image - the image data which should be prepared for comparison
Returns:
the prepared image data.