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

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

Description

equals

Declaration

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

Method Source Code

//package com.java2s;

public class Main {
    public static boolean equals(byte[] array1, byte[] array2, int length) {
        if (array1 == array2) {
            return true;
        }/*  w ww.j  av  a 2s.  co  m*/
        if (array1 == null || array2 == null || array1.length < length
                || array2.length < length) {
            return false;
        }
        for (int i = 0; i < length; i++) {
            if (array1[i] != array2[i]) {
                return false;
            }
        }
        return true;
    }
}

Related

  1. constantTimeAreEqual(byte[] a, byte[] b)
  2. equals(byte[] array1, byte[] array2)
  3. equals(byte[] array1, byte[] array2, int length)
  4. equals(byte[] array1, byte[] array2, int length)
  5. equals(final byte[] pArrayA, final int pOffsetA, final byte[] pArrayB, final int pOffsetB, final int pLength)
  6. equals(final byte[] pArrayA, final int pOffsetA, final byte[] pArrayB, final int pOffsetB, final int pLength)
  7. isEqual(byte[] first, byte[] second)
  8. equalByteArray(byte[] src, byte[] dst)