Class ByteArrayTagOrder

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

    public class ByteArrayTagOrder
    extends java.lang.Object
    implements java.util.Comparator<byte[]>, java.io.Serializable
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(byte[] bytes1, byte[] bytes2)
      Compare two byte arrays, by the order of their tags, as defined in ITU-T X.680, sec. 6.4.
      • 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

      • ByteArrayTagOrder

        public ByteArrayTagOrder()
    • Method Detail

      • compare

        public final int compare​(byte[] bytes1,
                                 byte[] bytes2)
        Compare two byte arrays, by the order of their tags, as defined in ITU-T X.680, sec. 6.4. (First compare tag classes, then tag numbers, ignoring the constructivity bit.)
        Specified by:
        compare in interface java.util.Comparator<byte[]>
        Parameters:
        bytes1 - first byte array to compare.
        bytes2 - second byte array to compare.
        Returns:
        negative number if bytes1 < bytes2, 0 if bytes1 == bytes2, positive number if bytes1 > bytes2.