Bitwise Manipulation
807569Jun 30 2006 — edited Jun 30 2006I 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......