
- Forum
- Programming Talk
- Java
- how do you create an unsigned 8 bit...
how do you create an unsigned 8 bit...
This is a discussion on how do you create an unsigned 8 bit... within the Java forums, part of the Programming Talk category; ...integer in java? need to create an 8 bit unsigned integer in java. Would also like some help in using ...
-
how do you create an unsigned 8 bit...
...integer in java? need to create an 8 bit unsigned integer in java. Would also like some help in using bit masks and bit shifting as I'm pretty sure that would be the answer to my original question.
-
alternative 1)Use int/short instead. Make sure you mask potential values with "& 0xff" so they don't overflow.alternative 2)Use (signed) byte for storage, but when doing comparisons, assignment to other integer types, cast to int/short and mask with 0xff

Reply With Quote





