CategoricalData / hydra

Transformations transformed
Apache License 2.0
72 stars 10 forks source link

uint8 type in Java should be Short, not Byte #120

Closed joshsh closed 1 month ago

joshsh commented 7 months ago

While Java's Byte type has the right bit precision for Hydra's uint8 type, by using it we are breaking with the convention of using either unsigned-and-equal, or signed-and-larger carrier types for Hydra's unsigned integer types. Specifically, the Byte type has a max value of 127, rather than the appropriate 255; you'd have to "cheat" to force negative byte values to be interpreted as positive uint8's. Fix this by using Short as the carrier type instead of Byte.