1

i try :

byte[] Data = { 0xA3, 0x34, 0x33, 0x33, 0x00};

but at "0xA3" it said "required byte found int",so what's problem here ?

JimmyN
  • 579
  • 4
  • 16

2 Answers2

2

0xA3 is 163 which is out of bounds for byte which I think can be -128 -> +127.

You can find more details here

Titus
  • 22,031
  • 1
  • 23
  • 33
1

at "0xA3" it said "required byte found int", so what's problem here

The problem is that the range of a byte in Java is -128..127.

The solution is that you need to write a (byte) cast in front of 0xA3.

user207421
  • 305,947
  • 44
  • 307
  • 483