How to easily change the formatted string as & ldquo; 20 0F 01 & rdquo; in hexadecimal values ​​in Java?


I've found method toHexString() but it converts string into hex, while the value is already converted (like "20 0F 01 etc."). What's the best way to get hex values from this String for later purposes (ex. adding, sending some of them to output device)?


Integer.parseInt(String val, int radix)

Example Integer.parseInt("-FF", 16) returns -255,%20int)