Код: Выделить всё
byte value = 0xfe; // corresponds to -2 (signed) and 254 (unsigned)
int result = value & 0xff;
Подробнее здесь: https://stackoverflow.com/questions/113 ... do-in-java
Код: Выделить всё
byte value = 0xfe; // corresponds to -2 (signed) and 254 (unsigned)
int result = value & 0xff;