Android Byte Array Compare compare(byte[] arr1, byte[] arr2)

Here you can find the source of compare(byte[] arr1, byte[] arr2)

Description

compare

Declaration

public static boolean compare(byte[] arr1, byte[] arr2) 

Method Source Code

//package com.java2s;

public class Main {
    public static boolean compare(byte[] arr1, byte[] arr2) {
        if (arr1 == null || arr2 == null) {
            return false;
        } else if (arr1.length != arr2.length) {
            return false;
        } else {/*from w ww. j a va2 s . c om*/
            for (int i = 0; i < arr1.length; i++) {
                if (arr1[i] != arr2[i]) {
                    return false;
                }
            }
        }
        return true;
    }
}

Related

  1. compareNotNull(byte[] data1, byte[] data2)
  2. compareSecure(byte[] test, byte[] good)
  3. compareTo(byte[] buffer1, int offset1, int length1, byte[] buffer2, int offset2, int length2)
  4. compareTo(final byte[] left, final byte[] right)
  5. areEqual(byte[] a, byte[] b)
  6. areByteArraysEqual(byte[] byteArray0, byte[] byteArray1)