Here you can find the source of areEqual(byte[] array1, byte[] array2)
Parameter | Description |
---|---|
array1 | The first array. |
array2 | The second array. |
public static boolean areEqual(byte[] array1, byte[] array2)
//package com.java2s; public class Main { /**//from w ww .j ava2s .c om * Determine if the two passed arrays have exactly the same values. * * @param array1 The first array. * @param array2 The second array. * * @return true if the arrays are equel, otherwise false. * * @author M. Del Pellegrino * @since 1 */ public static boolean areEqual(byte[] array1, byte[] array2) { boolean equality; if (array1.length == array2.length) { equality = true; for (int loop = 0; equality && loop < array1.length; loop++) { if (array1[loop] != array2[loop]) { equality = false; } } } else { equality = false; } return equality; } }