Java Array Compare areEquals(byte[] g1, byte[] g2)

Here you can find the source of areEquals(byte[] g1, byte[] g2)

Description

are Equals

License

Open Source License

Declaration

public static boolean areEquals(byte[] g1, byte[] g2) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static boolean areEquals(byte[] g1, byte[] g2) {
        if ((g1 == null && g2 == null) || (g1 == null && g2.length == 0)
                || (g2 == null && g1.length == 0))
            return true;
        boolean b = true;
        for (int i = 0; i < g1.length; i++)
            b = b && g1[i] == g2[i];
        return b;
    }/* w  w  w .  j  ava2  s  .c om*/
}

Related

  1. areEqual(byte[] array1, byte[] array2)
  2. AreEqual(double[] vector1, double[] vector2)
  3. areEqual(final byte[] a, final byte[] b)
  4. areEqualBytes(byte[] b1, byte[] b2)
  5. areEqualPropPaths(String[] pp1, String[] pp2)
  6. arrayCompare(byte src[], short srcOff, byte dest[], short destOff, short length)
  7. arrayCompare(byte[] a, byte[] a2)
  8. arrayCompare(byte[] a1, byte[] a2)
  9. arrayCompare(byte[] b1, byte[] b2)