Java examples for Language Basics:byte
Compare Two Java byte Arrays
import java.util.Arrays; public class Main { public static void main(String[] args) { byte[] byteArray1 = new byte[]{7,2,1}; byte[] byteArray2 = new byte[]{7,2,1}; /*from www . jav a2 s. com*/ boolean blnResult = Arrays.equals(byteArray1,byteArray2); System.out.println("Are two byte arrays equal ? : " + blnResult); } }