org.opennms.core.utils
Class ByteArrayComparator

java.lang.Object
  extended by org.opennms.core.utils.ByteArrayComparator
All Implemented Interfaces:
Comparator<byte[]>

public class ByteArrayComparator
extends Object
implements Comparator<byte[]>

Comparator that is used to compare byte arrays. This should be used to compare IP addresses using InetAddress.getAddress() and can be used to compare any pair of IPv4 and/or IPv6 addresses.

Author:
Seth

Constructor Summary
ByteArrayComparator()
           
 
Method Summary
 int compare(byte[] a, byte[] b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

ByteArrayComparator

public ByteArrayComparator()
Method Detail

compare

public int compare(byte[] a,
                   byte[] b)
Specified by:
compare in interface Comparator<byte[]>


Copyright © 2011. All Rights Reserved.