MCPcopy Create free account
hub / github.com/davidgiven/luje / equals

Method equals

lib/java/util/Arrays.java:1162–1175  ·  view source on GitHub ↗

Compares the two arrays. @param array1 the first byte array. @param array2 the second byte array. @return true if both arrays are null or if the arrays have the same length and the elements at each index in the two arrays are equ

(byte[] array1, byte[] array2)

Source from the content-addressed store, hash-verified

1160 * equal, {@code false} otherwise.
1161 */
1162 public static boolean equals(byte[] array1, byte[] array2) {
1163 if (array1 == array2) {
1164 return true;
1165 }
1166 if (array1 == null || array2 == null || array1.length != array2.length) {
1167 return false;
1168 }
1169 for (int i = 0; i < array1.length; i++) {
1170 if (array1[i] != array2[i]) {
1171 return false;
1172 }
1173 }
1174 return true;
1175 }
1176
1177 /**
1178 * Compares the two arrays.

Callers 1

deepEqualsElementsMethod · 0.95

Calls 3

floatToIntBitsMethod · 0.95
doubleToLongBitsMethod · 0.95
equalsMethod · 0.95

Tested by

no test coverage detected