Detailed Problem Description:
The issue appears when the ObjectBuffer is created with an initial capacity
that is lower than the object data to read. (If the initial capacity is
greater than the size of the object to read, the issue does not appear).
The source of the problem seems to reside in the resizeBuffer method in the
following statement:
if (preserveContents) newBuffer.put(buffer);
newBuffer.put only transfers the REMAINING bytes of buffer (the source
buffer). I think the statement should be corrected to:
if (preserveContents) {
buffer.position(0);
newBuffer.put(buffer);
}
What is the expected output? What do you see instead?
Without the fix above I get a wrong sequence of bytes due to copying only
remaining bytes when resizing the buffer.
What version of the Kryo are you using?
Version 1.0
Original issue reported on code.google.com by martin.r...@gmail.com on 23 Mar 2010 at 8:18
Original issue reported on code.google.com by
martin.r...@gmail.com
on 23 Mar 2010 at 8:18