Java Byte Array Compare ArrayByteCompare(byte[] a, byte[] b)

Here you can find the source of ArrayByteCompare(byte[] a, byte[] b)

Description

Array Byte Compare

License

Apache License

Declaration

public static boolean ArrayByteCompare(byte[] a, byte[] b) 

Method Source Code

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

public class Main {
    public static boolean ArrayByteCompare(byte[] a, byte[] b) {
        boolean ret = true;

        if (a.length == b.length) {
            for (int i = 0; i < a.length; i++) {
                if (a[i] != b[i]) {
                    ret = false;/*from  w  ww. j a v  a 2  s .com*/
                    break;
                }
            }
        } else {
            ret = false;
        }

        return ret;
    }
}

Related

  1. allEquals(byte[] array, byte value, int offset, int maxLength)
  2. bytesCmp(byte[] oi, byte[] oj)
  3. bytesCompare(byte[] a, byte[] b)
  4. bytesCompare(byte[] a, byte[] b)
  5. bytesCompare(byte[] bytes1, byte[] bytes2)