Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Bitwise Manipulation

807569Jun 30 2006 — edited Jun 30 2006
I am new to Java Programming.I want to make bitwise manipulation.

For example
I want to send Year and month in a single byte.
i.e first 6 bits of byte, i want to represent Year and next 2 bits (high-bits) I want to represent month and next 2 low-bits of month representation follow in next byte.

ex: Year (00=1990, 01=1991 ranges up to 62=2052) X X X X X X
Month (1-12) X X (high-bits)-one complete byte
X X (low-bits)-this will follow in next byte.

I hope u understood my question.I have gone through the documentation for Bitwise operators and java.util.BitSet Class.I am exactly not understanding how to implement them?

Please provide me with Solution,sample code or any online resource......
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 28 2006
Added on Jun 30 2006
1 comment
169 views