Class ByteArrayComparator

  • All Implemented Interfaces:
    java.util.Comparator<byte[]>

    public class ByteArrayComparator
    extends java.lang.Object
    implements java.util.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 <seth@opennms.org>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Constructor Detail

      • ByteArrayComparator

        public ByteArrayComparator()
    • Method Detail

      • compare

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