Java Array Equal arraysEqual(byte[] bytes, byte[] ints)

Here you can find the source of arraysEqual(byte[] bytes, byte[] ints)

Description

arrays Equal

License

Open Source License

Declaration

public static boolean arraysEqual(byte[] bytes, byte[] ints) 

Method Source Code

//package com.java2s;
// it under the terms of the GNU General Public License as published by

public class Main {
    public static boolean arraysEqual(byte[] bytes, byte[] ints) {
        if (bytes == null || ints == null) {
            return false;
        }//from  w  w w . j a v a  2  s  .  c  om

        if (bytes.length != ints.length) {
            return false;
        }

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

Related

  1. arraysAreEqual(double[] a1, double[] a2)
  2. arraysAreEqual(final byte[] array1, final byte[] array2)
  3. arraysAreEqual(Object value, Object otherValue)
  4. arraysEqual(boolean[] a, boolean[] b)
  5. arraysEqual(byte array1[], byte array2[])
  6. arraysEqual(final Object[] a1, final Object[] a2)
  7. arraysEqual(Object[] array1, Object[] array2)
  8. arraysEqual(String[] arr1, String[] arr2)
  9. arraysEqual(String[] one, String[] other)