-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
Hi,
I'm not sure but I think the method bitReader in the class Int32 is wrong.
My fix is on the masks. I think it should be :
$hiMask = $bitmask->getMask($br->getCurrentBit(), BitMask::MASK_LO) ^ 0xFF;
$loMask = $bitmask->getMask($br->getCurrentBit(), BitMask::MASK_HI) ^ 0xFF;
Case :
Buffer :
FF 07 00 00 00
Position : 1 (2nd byte)
Current bit : 2
Nest Byte : FF
Try to read int32.
The masks are :
hiMask : 00111111
loMask : 00000011
But should be :
hiMask : 11111100
loMask : 11000000
The result will be 1058799616 (111111000111000000000000000000) and should be 4229693440 (11111100000111000000000000000000).
nsknewbie
Metadata
Metadata
Assignees
Labels
No labels