During serialization starting with references > 255 the reference numbers will be serialized incorrectly:
Method: CHessianOutput.WriteRef((int intValue)
Old Code:
m_srOutput.WriteByte((byte) PROT_REF_TYPE);
m_srOutput.WriteByte((byte) (intValue << 24));
m_srOutput.WriteByte((byte) (intValue << 16));
m_srOutput.WriteByte((byte) (intValue << 8));
m_srOutput.WriteByte((byte)intValue);
Problem:
The bit-shift goes into the wrong direction, resulting actually in intValue % 256.
Corrected Code:
m_srOutput.WriteByte((byte) PROT_REF_TYPE);
m_srOutput.WriteByte((byte)(intValue >> 24));
m_srOutput.WriteByte((byte)(intValue >> 16));
m_srOutput.WriteByte((byte)(intValue >> 8));
m_srOutput.WriteByte((byte)intValue);
Hope this will help others with serialization-Problems ;)
Cheers, Arndt