Can anybody please explain what is happening below;how does the following bit shift works?
Dim pBuffer(11) As Int
pBuffer(0)=4
'Firmware Version'
pBuffer(1)=Bit.ShiftRight(Bit.And(firmware_version, 0xFF00),8)
pBuffer(2)=Bit.And(firmware_version, 0xFF)
Consider firmware_version = 0001
What will be the equivalent java code for this? Can I use Bit.ShiftRight in java? I checked the Java classes and didnt quite understand what will be the equivalent 'Bit.ShiftRight' operation in java?
EDIT: Can you explain what exactly is happening here?
pBuffer(1)=Bit.ShiftRight(Bit.And(firmware_version, 0xFF00),8)
How is the AND performed and the bit shift? What is it performed on? Is firmware_version AND 0xFF00 or is it bit shift first? Can you please explain?