Java Array Equal equals(byte[] first, byte[] second)

Here you can find the source of equals(byte[] first, byte[] second)

Description

This function compares two byte arrays to see if they are equal.

License

Open Source License

Parameter

Parameter Description
first The first byte array.
second The second byte array.

Return

Whether or not the two byte arrays are equal.

Declaration

static public boolean equals(byte[] first, byte[] second) 

Method Source Code

//package com.java2s;
/************************************************************************
 * Copyright (c) Crater Dog Technologies(TM).  All Rights Reserved.     *
 ************************************************************************
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.        *
 *                                                                      *
 * This code is free software; you can redistribute it and/or modify it *
 * under the terms of The MIT License (MIT), as published by the Open   *
 * Source Initiative. (See http://opensource.org/licenses/MIT)          *
 ************************************************************************/

import java.util.Arrays;

public class Main {
    /**/*from w  ww . j  a  v  a 2 s . co m*/
     * This function compares two byte arrays to see if they are equal.
     *
     * @param first The first byte array.
     * @param second The second byte array.
     * @return Whether or not the two byte arrays are equal.
     */
    static public boolean equals(byte[] first, byte[] second) {
        return Arrays.equals(first, second);
    }
}

Related

  1. equalOrDie(String testName, Object[] a, Object[] b)
  2. equals(byte[] a, byte[] b)
  3. equals(byte[] a1, byte[] a2)
  4. equals(byte[] data1, byte[] data2)
  5. equals(byte[] first, byte[] second)
  6. equals(char[] left, int offsetLeft, char[] right, int offsetRight, int length)
  7. equals(char[] left, int offsetLeft, char[] right, int offsetRight, int length)
  8. equals(char[] str1, char[] str2)
  9. equals(char[][] c1, char[][] c2)