I know about Arrays.deepEquals(Object[], Object[]) but this doesn't work for primitive types (due limitations of arrays and autoboxing, see [this related post][1]).
With that in mind, is this the most efficient approach?
boolean byteArrayEquals(byte[] a, byte[] b) {
if (a == null && b == null)
return true;
if (a == null || b == null)
return false;
if (a.length != b.length)
return false;
for (int i = 0; i
以上就是Compare two arrays of primitives in Java?的详细内容,更多请关注web前端其它相关文章!