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.
While Java's
Byte
type has the right bit precision for Hydra'suint8
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, theByte
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 usingShort
as the carrier type instead ofByte
.