Android Byte Array Equal equals(byte[] array1, byte[] array2)

Here you can find the source of equals(byte[] array1, byte[] array2)

Description

equals

Declaration

public static boolean equals(byte[] array1, byte[] array2) 

Method Source Code

//package com.java2s;

public class Main {

    public static boolean equals(byte[] array1, byte[] array2) {
        if (array1 == array2) {
            return true;
        }/*  www . j  a va 2 s .  c  om*/

        if (array1 == null || array2 == null) {
            return false;
        }

        if (array1.length != array2.length) {
            return false;
        }

        for (int i = 0; i < array1.length; i++) {
            if (array1[i] != array2[i]) {
                return false;
            }
        }

        return true;
    }
}

Related

  1. equals(final byte[] pArrayA, final int pOffsetA, final byte[] pArrayB, final int pOffsetB, final int pLength)
  2. isEqual(byte[] first, byte[] second)
  3. equalByteArray(byte[] src, byte[] dst)
  4. equalByteArray(byte[] src, int srcOffset, int srcLen, byte[] dst, int dstOffset, int dstLen)
  5. equals(byte[] a1, byte[] a2)
  6. equals(byte[] left, byte[] right)
  7. equals(int[] a1, int[] a2)