public class ByteArr { public static void main(String[] args){ Byte[] a = {(byte)0x03, (byte)0x00, (byte)0x00, (byte)0x00}; Byte[] b = {(byte)0x
have you looked at Arrays.equals()?
Edit: if, as per your comment, the issue is using a byte array as a HashMap key then see this question.