Package edu.caltech.nanodb.util
Class ArrayUtil
- java.lang.Object
-
- edu.caltech.nanodb.util.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.
-
-
-
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 examineb
- the second array to examineindex
- 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 examineb
- the second array to examineindex
- the index to start the comparison at- Returns:
- the number of bytes that are different, starting from the specified index
-
-