I have a unsigned data representation like this:
val str = "145 38 0 255 0 1"
I want to now get this unsigned representation as a byteString after which I can manipulate on the individual bits to extract information. So basically what I want is to get the unsigned version.
For example., the unsigned binary representation of 145 is 10010001, but the signed version is -00000111.
scala> 145.byteValue
res128: Byte = -111 // I would need an unsigned value instead!
So is there a function or an approach to convert the 145 to an unsigned representation?