View Single Post
Old 08-13-2008, 10:39 AM   #1 (permalink)
New Member
Join Date: Aug 2008
Model: curve
Carrier: tmobile
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default C conversion issue

Please Login to Remove!

I'm working on a converting a c program to java for the blackberry and I was wondering what is the best way to convert the following c snippet to java.

	typedef struct foo
		unsigned int field1:12;
		unsigned int field2:4; 
		unsigned int field3:16;
I was going to create a class to encapsulate everything however getting the data packed into a byte array correctly is bothering me. I know it's going to involve some bit shifting but i have no idea how to do it at the moment.

Any ideas,
Offline   Reply With Quote