Android Byte Array Equal equals(byte[] left, byte[] right)

Here you can find the source of equals(byte[] left, byte[] right)

Description

equals

Declaration

public static boolean equals(byte[] left, byte[] right) 

Method Source Code

//package com.java2s;

public class Main {
    public static boolean equals(byte[] left, byte[] right) {
        if (left == null) {
            return right == null;
        }/* ww w . j a v a2  s.c  o m*/
        if (right == null) {
            return false;
        }

        if (left.length != right.length) {
            return false;
        }
        boolean result = true;
        for (int i = left.length - 1; i >= 0; i--) {
            result &= left[i] == right[i];
        }
        return result;
    }
}

Related

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