Assuming it is available as binary data from a non-Java source that you should read and work with values ββin Java: Read it as a (signed) short , and then convert it to int as follows:
int intVal = shortVal >= 0 ? shortVal : 0x10000 + shortVal
You cannot represent all unsigned short values ββin short, but in int, you can.
Frank
source share