Exforsys
+ Reply to Thread
Results 1 to 2 of 2

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 ...

  1. #1
    Ben C is offline Junior Member Array
    Join Date
    Mar 2007
    Answers
    1

    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.


  2. #2
    Ron V is offline Junior Member Array
    Join Date
    Mar 2007
    Answers
    1
    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


Latest Article

Network Security Risk Assessment and Measurement

Read More...