I got a stream of byte this stream is a bytearray ( byte[] stream ) now i want parse this byte first to an hex value, e.g. 80 = "0x50" then transform this to an int
But for some values like 0xB8 i got an `java.lang.NumberFormatException: For input string: "0xB8"
How could i manage this exception? Maybe with an other type of parse or different type data?
byte k = stream[i];
int b = 0;
try {
b = Integer.parseInt(String.format("0x%02X",k),16);
} catch (NumberFormatException e) {
e.printStackTrace();
}