Exforsys

Online Training

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


Go Back   Exforsys > Programming Talk > Java

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-19-2007, 01:10 PM
Junior Member
 
Join Date: Mar 2007
Posts: 1
Ben C is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-19-2007, 03:10 PM
Junior Member
 
Join Date: Mar 2007
Posts: 1
Ron V is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

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


All times are GMT -4. The time now is 12:45 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.