mismatch
Returns the first index i (0 ≤ i < len) for which aaOffset + i != bbOffset + i. If no such index exists, returns -1.
Finds and returns the relative index of the first mismatch between two byte arrays over the specified ranges, otherwise return -1 if no mismatch is found. The index will be in the range of 0 (inclusive) up to the length (inclusive) of the smaller range.
If the two arrays, over the specified ranges, share a common prefix then the returned relative index is the length of the common prefix and it follows that there is a mismatch between the two elements at that relative index within the respective arrays. If one array is a proper prefix of the other, over the specified ranges, then the returned relative index is the length of the smaller range and it follows that the relative index is only valid for the array with the larger range. Otherwise, there is no mismatch.
Two non-null arrays, a and b with specified ranges [aFromIndex, aToIndex) and [bFromIndex, bToIndex) respectively, share a common prefix of length pl if the following expression is true:
`pl >= 0 && pl < Math.min(aToIndex - aFromIndex, bToIndex - bFromIndex) && Arrays.equals(a, aFromIndex, aFromIndex + pl, b, bFromIndex, bFromIndex + pl) && a[aFromIndex + pl] != b[bFromIndex + pl] `*
Note that a common prefix length of 0 indicates that the first elements from each array mismatch.
Two non-null arrays, a and b with specified ranges [aFromIndex, aToIndex) and [bFromIndex, bToIndex) respectively, share a proper prefix if the following expression is true:
`(aToIndex - aFromIndex) != (bToIndex - bFromIndex) && Arrays.equals(a, 0, Math.min(aToIndex - aFromIndex, bToIndex - bFromIndex), b, 0, Math.min(aToIndex - aFromIndex, bToIndex - bFromIndex)) `*
Return
the relative index of the first mismatch between the two arrays over the specified ranges, otherwise -1.
Since
9
Parameters
the first array to be tested for a mismatch
the index (inclusive) of the first element in the first array to be tested
the index (exclusive) of the last element in the first array to be tested
the second array to be tested for a mismatch
the index (inclusive) of the first element in the second array to be tested
the index (exclusive) of the last element in the second array to be tested
Throws
if aFromIndex > aToIndex or if bFromIndex > bToIndex
if aFromIndex < 0 or aToIndex > a.length or if bFromIndex < 0 or bToIndex > b.length
if either array is null
Finds and returns the relative index of the first mismatch between two int arrays over the specified ranges, otherwise return -1 if no mismatch is found. The index will be in the range of 0 (inclusive) up to the length (inclusive) of the smaller range.
If the two arrays, over the specified ranges, share a common prefix then the returned relative index is the length of the common prefix and it follows that there is a mismatch between the two elements at that relative index within the respective arrays. If one array is a proper prefix of the other, over the specified ranges, then the returned relative index is the length of the smaller range and it follows that the relative index is only valid for the array with the larger range. Otherwise, there is no mismatch.
Two non-null arrays, a and b with specified ranges [aFromIndex, aToIndex) and [bFromIndex, bToIndex) respectively, share a common prefix of length pl if the following expression is true:
`pl >= 0 && pl < Math.min(aToIndex - aFromIndex, bToIndex - bFromIndex) && Arrays.equals(a, aFromIndex, aFromIndex + pl, b, bFromIndex, bFromIndex + pl) && a[aFromIndex + pl] != b[bFromIndex + pl] `*
Note that a common prefix length of 0 indicates that the first elements from each array mismatch.
Two non-null arrays, a and b with specified ranges [aFromIndex, aToIndex) and [bFromIndex, bToIndex) respectively, share a proper prefix if the following expression is true:
`(aToIndex - aFromIndex) != (bToIndex - bFromIndex) && Arrays.equals(a, 0, Math.min(aToIndex - aFromIndex, bToIndex - bFromIndex), b, 0, Math.min(aToIndex - aFromIndex, bToIndex - bFromIndex)) `*
Return
the relative index of the first mismatch between the two arrays over the specified ranges, otherwise -1.
Since
9
Parameters
the first array to be tested for a mismatch
the index (inclusive) of the first element in the first array to be tested
the index (exclusive) of the last element in the first array to be tested
the second array to be tested for a mismatch
the index (inclusive) of the first element in the second array to be tested
the index (exclusive) of the last element in the second array to be tested
Throws
if aFromIndex > aToIndex or if bFromIndex > bToIndex
if aFromIndex < 0 or aToIndex > a.length or if bFromIndex < 0 or bToIndex > b.length
if either array is null
Returns the first index (0 ≤ i < len) at which the elements of the two IntArrays differ, when compared over the given length starting at aFromIndex and bFromIndex respectively. Returns -1 if no mismatch is found.
Finds and returns the relative index of the first mismatch between two {@code char} arrays over the specified ranges, otherwise return -1 if no mismatch is found. The index will be in the range of 0 (inclusive) up to the length (inclusive) of the smaller range.
If the two arrays, over the specified ranges, share a common prefix then the returned relative index is the length of the common prefix and it follows that there is a mismatch between the two elements at that relative index within the respective arrays. If one array is a proper prefix of the other, over the specified ranges, then the returned relative index is the length of the smaller range and it follows that the relative index is only valid for the array with the larger range. Otherwise, there is no mismatch.
Two non-{@code null} arrays, {@code a} and {@code b} with specified ranges [{@code aFromIndex}, {@code aToIndex}) and [{@code bFromIndex}, {@code bToIndex}) respectively, share a common prefix of length {@code pl} if the following expression is true:
{@code
pl >= 0 &&
pl < Math.min(aToIndex - aFromIndex, bToIndex - bFromIndex) &&
Arrays.equals(a, aFromIndex, aFromIndex + pl, b, bFromIndex, bFromIndex + pl) &&
a[aFromIndex + pl] != b[bFromIndex + pl]
}
Note that a common prefix length of {@code 0} indicates that the first
elements from each array mismatch.Two non-{@code null} arrays, {@code a} and {@code b} with specified ranges [{@code aFromIndex}, {@code aToIndex}) and [{@code bFromIndex}, {@code bToIndex}) respectively, share a proper prefix if the following expression is true:
{@code
(aToIndex - aFromIndex) != (bToIndex - bFromIndex) &&
Arrays.equals(a, 0, Math.min(aToIndex - aFromIndex, bToIndex - bFromIndex),
b, 0, Math.min(aToIndex - aFromIndex, bToIndex - bFromIndex))
}Return
the relative index of the first mismatch between the two arrays over the specified ranges, otherwise {@code -1}.
Since
9
Parameters
the first array to be tested for a mismatch
the index (inclusive) of the first element in the first array to be tested
the index (exclusive) of the last element in the first array to be tested
the second array to be tested for a mismatch
the index (inclusive) of the first element in the second array to be tested
the index (exclusive) of the last element in the second array to be tested
Throws
if {@code aFromIndex > aToIndex} or
if {@code bFromIndex > bToIndex} if {@code aFromIndex < 0 or aToIndex > a.length} or
if {@code bFromIndex < 0 or bToIndex > b.length} if either array is {@code null}