Affects Version/s: 1.3.1
Fix Version/s: 1.4
JDK version and platform:Sun 1.6.0_14 for Windows, Apple 1.6.0_13 for OS X
Due to the BInary IO using readUTF() and writeUTF() long strings (such as embedded XML documents) can't be written and read back.
I've attached a patch which updates com.thoughtworks.xstream.io.binary.Token and it's test.
This fix may not be as robust as read/writeUTF as it just uses String.getBytes(). So there may be a better way to do this, however it worked fine for my test cases.
thanks for spotting this. I took a bit a different strategy, because I wanted to ensure that the new version will be able to read data written with the old one and your detection of the limit is wrong since you count the characters of the string and not its bytes (think about a Chinese text with 4 bytes each character). You can check it out yourself, it's committed to trunk.
Ah yes, your fix is an improved version of my first patch. Thanks for fixing this!
Improved patch that used multi-part read/writeUTF rather than String.getBytes().