List of utility methods to do Byte Array Equal
boolean | bytesEqual(byte[] a1, byte[] a2) bytes Equal int i; if (a1.length != a2.length) { return false; for (i = 0; i < a1.length; i++) { if (a1[i] != a2[i]) { return false; return true; |
boolean | bytesEqual(byte[] buf1, byte[] buf2, int off, int len) bytes Equal for (int i = off; i < off + len; i++) { if (i >= buf1.length || i >= buf2.length) { return false; if (buf1[i] != buf2[i]) { return false; return true; |
boolean | bytesEqual(final byte[] a, final byte[] b) True iff the two arrays compare as equal. if (a == b) return true; final int alen = a.length; final int blen = b.length; if (alen != blen) return false; int i = alen - 1; while (i >= 0) { ... |
boolean | bytesEqual(final byte[] b1, final int j, final byte[] b2, final int k, final int len) Return true if the byte ranges are identical. for (int i = 0; i < len; i++) { if (b1[i + j] != b2[i + k]) return false; return true; |
boolean | bytesEqual(final byte[] source, final int offset, final byte[] target) Utility method to determine whether a subarray of bytes in a byte-array source matches the byte-array in target .
for (int index = 0; index < target.length; index++) { if (source[index + offset] != target[index]) { return false; return true; |