Android Byte Array Equal equals(int[] a1, int[] a2)

Here you can find the source of equals(int[] a1, int[] a2)

Description

equals

Declaration

static public boolean equals(int[] a1, int[] a2) 

Method Source Code

//package com.java2s;

public class Main {

    static public boolean equals(byte[] a1, byte[] a2) {
        if ((a1 == null) || (a2 == null)) {
            return a1 == a2;
        }/* ww  w .j  a va  2 s  .  c o m*/
        int nLength = a1.length;
        if (nLength != a2.length) {
            return false;
        }
        for (int i = 0; i < nLength; i++) {
            if (a1[i] != a2[i]) {
                return false;
            }
        }
        return true;
    }

    static public boolean equals(int[] a1, int[] a2) {
        if ((a1 == null) || (a2 == null)) {
            return a1 == a2;
        }
        int nLength = a1.length;
        if (nLength != a2.length) {
            return false;
        }
        for (int i = 0; i < nLength; i++) {
            if (a1[i] != a2[i]) {
                return false;
            }
        }
        return true;
    }
}

Related

  1. equalByteArray(byte[] src, byte[] dst)
  2. equalByteArray(byte[] src, int srcOffset, int srcLen, byte[] dst, int dstOffset, int dstLen)
  3. equals(byte[] a1, byte[] a2)
  4. equals(byte[] array1, byte[] array2)
  5. equals(byte[] left, byte[] right)