Here you can find the source of equalityCheck(byte[] a, byte[] b)
Parameter | Description |
---|---|
a | a parameter |
b | a parameter |
public static boolean equalityCheck(byte[] a, byte[] b)
//package com.java2s; import java.util.Arrays; public class Main { /**/*from w w w . j av a2s. c om*/ * Checks for variety of equality conditions. * * @param a * @param b * @return 1. If object reference are equal than return true 2. If only one of the object reference is null than * return false 3. return if contents of a is equal to b via a.equals(b) */ public static boolean equalityCheck(Object a, Object b) { if (a == b) return true; if (a == null || b == null) return false; return a.equals(b); } /** * Checks for variety of equality conditions. * * @param a * @param b * @return 1. If byte[] reference are equal than return true 2. If only one of the byte[] reference is null than * return false 3. return if contents of a is equal to b via Arrays.equals(a,b) */ public static boolean equalityCheck(byte[] a, byte[] b) { if (a == b) return true; if (a == null || b == null) return false; return Arrays.equals(a, b); } }