Here you can find the source of byteArrayEquals(final byte[] actual, final byte[] expected)
public static final boolean byteArrayEquals(final byte[] actual, final byte[] expected)
//package com.java2s; /**/*www .j a v a 2s . c o m*/ * Copyright (C) 2014 Bnome SPRL (info@bnome.be) * * This file is part of VectionVR Stabilizer library. * * VectionVR Stabilizer library is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * VectionVR Stabilizer library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with VectionVR Stabilizer library. If not, see <http://www.gnu.org/licenses/>. */ public class Main { public static final boolean byteArrayEquals(final byte[] actual, final byte[] expected) { if (actual != null && expected != null && actual.length == expected.length) { for (int index = 0; index < actual.length; ++index) { if (actual[index] != expected[index]) { return false; } } return true; } return false; } }