byte array to unsigned int in java

后端 未结 4 1878
暗喜
暗喜 2021-01-05 04:34

I\'m converting a byte array into int by doing this:

ByteArrayInputStream bais = new ByteArrayInputStream (data);
DataInputStream dis = new Data         


        
4条回答
  •  轮回少年
    2021-01-05 05:33

    Java does not have unsigned int, so you'll have to manually invert the bits to get an unsigned value if you absolutely need to have one.

    Got this from Google.

提交回复
热议问题