Here you can find the source of equals(byte[] a1, byte[] a2)
public static boolean equals(byte[] a1, byte[] a2)
//package com.java2s; // in accordance with the terms of the license agreement accompanying it. import java.util.Arrays; public class Main { public static boolean equals(Object[] a1, Object[] a2) { return Arrays.equals(a1, a2); }/*from w ww . j a v a2s . c om*/ public static boolean equals(byte[] a1, byte[] a2) { return Arrays.equals(a1, a2); } public static boolean equals(long[] a1, long[] a2) { return Arrays.equals(a1, a2); } public static boolean equals(int[] a1, int[] a2) { return Arrays.equals(a1, a2); } public static boolean equals(double[] a1, double[] a2) { return Arrays.equals(a1, a2); } public static boolean equals(char[] a1, char[] a2) { return Arrays.equals(a1, a2); } public static boolean equals(short[] a1, short a2[]) { return Arrays.equals(a1, a2); } }