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
  • 539
  • 4
  • 13

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
  • 21,281
  • 1
  • 21
  • 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
  • 298,294
  • 41
  • 291
  • 462