Can we make unsigned byte in Java

前端 未结 16 1374
青春惊慌失措
青春惊慌失措 2020-11-22 08:02

I am trying to convert a signed byte in unsigned. The problem is the data I am receiving is unsigned and Java does not support unsigned byte, so when it reads the data it tr

16条回答
  •  广开言路
    2020-11-22 08:42

    If you have a function which must be passed a signed byte, what do you expect it to do if you pass an unsigned byte?

    Why can't you use any other data type?

    Unsually you can use a byte as an unsigned byte with simple or no translations. It all depends on how it is used. You would need to clarify what you indend to do with it.

提交回复
热议问题