Here you can find the source of equals(byte[] data1, byte[] data2)
public static boolean equals(byte[] data1, byte[] data2)
//package com.java2s; /**/*from w w w . j a v a2s .co m*/ * Project: ${puma-common.aid} * * File Created at 2012-6-24 * $Id$ * * Copyright 2010 dianping.com. * All rights reserved. * * This software is the confidential and proprietary information of * Dianping Company. ("Confidential Information"). You shall not * disclose such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered into * with dianping.com. */ import java.util.Arrays; public class Main { public static boolean equals(byte[] data1, byte[] data2) { return Arrays.equals(data1, data2); } }