Class ArrayUtil


  • public class ArrayUtil
    extends java.lang.Object
    Some helpful utility operations for working with arrays.
    • Constructor Summary

      Constructors 
      Constructor Description
      ArrayUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int sizeOfDifferentRange​(byte[] a, byte[] b, int index)
      This function reports how many bytes are different between two arrays, starting at the specified index.
      static int sizeOfIdenticalRange​(byte[] a, byte[] b, int index)
      This function reports how many bytes are identical between two arrays, starting at the specified index.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ArrayUtil

        public ArrayUtil()
    • Method Detail

      • sizeOfIdenticalRange

        public static int sizeOfIdenticalRange​(byte[] a,
                                               byte[] b,
                                               int index)
        This function reports how many bytes are identical between two arrays, starting at the specified index. The arrays are expected to be the same length.
        Parameters:
        a - the first array to examine
        b - the second array to examine
        index - the index to start the comparison at
        Returns:
        the number of bytes that are the same, starting from the specified index
      • sizeOfDifferentRange

        public static int sizeOfDifferentRange​(byte[] a,
                                               byte[] b,
                                               int index)
        This function reports how many bytes are different between two arrays, starting at the specified index. The arrays are expected to be the same length.
        Parameters:
        a - the first array to examine
        b - the second array to examine
        index - the index to start the comparison at
        Returns:
        the number of bytes that are different, starting from the specified index