Here you can find the source of arraysAreEqual(final byte[] array1, final byte[] array2)
Parameter | Description |
---|---|
array1 | The first array |
array2 | the second array |
public static final boolean arraysAreEqual(final byte[] array1, final byte[] array2)
//package com.java2s; public class Main { /**/*from ww w .j a v a 2 s . co m*/ * Check if two byte arrays are equal. * * @param array1 The first array * @param array2 the second array * @return Returns true if the arrays are equal otherwise false */ public static final boolean arraysAreEqual(final byte[] array1, final byte[] array2) { if (array1.length != array2.length) return false; for (int i = 0; i < array1.length; i++) { if (array1[i] != array2[i]) return false; } return true; } }