Class ByteUtil


  • public final class ByteUtil
    extends Object
    Utility methods for bytes
    • Method Detail

      • compareSortedBytes

        public static int compareSortedBytes​(byte[] bytes1,
                                             byte[] bytes2)
        Compares two sorted byte arrays.
        Parameters:
        bytes1 - the first byte array
        bytes2 - the second byte array
        Returns:
        a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
      • areSortedBytesEqual

        public static boolean areSortedBytesEqual​(byte[] bytes1,
                                                  byte[] bytes2)
        Copy of the isEqual method in org.apache.accumulo.core.data.Key.
        Parameters:
        bytes1 - first array of bytes to test
        bytes2 - second array of bytes to test
        Returns:
        true if the provided bytes are equal