Java Utililty Methods Byte Array Equal

List of utility methods to do Byte Array Equal

Description

The list of methods to do Byte Array Equal are organized into topic(s).

Method

booleanbytesEqual(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;
booleanbytesEqual(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;
booleanbytesEqual(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) {
...
booleanbytesEqual(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;
booleanbytesEqual(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;