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 ...
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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.
__________________
Powered by Yahoo! Answers |
|
|||
|
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
__________________
Powered by Yahoo! Answers |
![]() |
| Thread Tools | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Solaris x86 FAQ 1/2 | Dan Anderson | Tech FAQ | 2 | 09-23-2008 04:15 AM |
| WebSphere V5.0 : Create Java project... | lokeshm | Java | 0 | 05-29-2006 11:19 AM |
| Quarterly ASCII posting of Caldera (SCO) OpenUNIX 8 FAQ | Boyd Lynn Gerber | Tech FAQ | 0 | 04-25-2004 11:11 PM |
| Kerberos FAQ, v2.0 (last modified 8/18/2000) | Ken Hornstein | Tech FAQ | 0 | 04-17-2004 08:28 AM |
| [FAQ] FileMaker Pro - database for Macintosh and Windows | Martin Trautmann | Tech FAQ | 0 | 04-17-2004 08:26 AM |