Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.1
-
Fix Version/s: None
-
Component/s: Framework
-
Labels:None
-
Number of attachments :
Description
From my understanding the encoder for the ByteAligningCodec in the ByteAligningDecorator class appears incorrect.
The javadoc says that the ByteAligning will occur after the value has been read, and this is what the decoder does.
However when I was trying to encode a class, the results did not match and I tracked it down to the fact that the encoder does ByteAligning first and then encodes the value.
Therefore, for eg. it appears to be doing the following:
Expected: True, True, True, True, True, True, Byte Align 2 bits
Actual: True, True, True, True, True, Byte Align 3 bits, True (start of next byte)
This therefore causes everything preceding to be off by 1 bit.
I fixed this by creating a new ByteAlignDecorator that will do the encode call "decorated.encode(object, channel, resolver);" before byte align and all works as expected.
I guess this should be at the github Issue Tracker instead?