Java Byte Array Equal bytesEqual(byte[] a1, byte[] a2)

Here you can find the source of bytesEqual(byte[] a1, byte[] a2)

Description

bytes Equal

License

Apache License

Declaration

public static boolean bytesEqual(byte[] a1, byte[] a2) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static boolean bytesEqual(byte[] a1, byte[] a2) {
        int i;/*w  ww.  ja va2  s  .c o m*/
        if (a1.length != a2.length) {
            return false;
        }
        for (i = 0; i < a1.length; i++) {
            if (a1[i] != a2[i]) {
                return false;
            }
        }
        return true;
    }
}

Related

  1. bytesEqual(byte[] a, byte[] b)
  2. bytesEqual(byte[] a, byte[] b, int len)
  3. bytesEqual(byte[] a, int aFrom, int aLen, byte[] b, int bFrom, int bLen)
  4. bytesEqual(byte[] a, int aOff, byte[] b, int bOff, int len)
  5. bytesEqual(byte[] a1, byte[] a2)
  6. bytesEqual(byte[] buf1, byte[] buf2, int off, int len)
  7. bytesEqual(final byte[] a, final byte[] b)
  8. bytesEqual(final byte[] b1, final int j, final byte[] b2, final int k, final int len)
  9. bytesEqual(final byte[] source, final int offset, final byte[] target)