-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
org.boon.primitive.CharBuf.toCharArray() returns data followed by unexpected characters #340
Comments
Another way to do it while avoiding the copy and preserving the performance is as follows: JsonSerializer serializer = mapper.serializer(); |
CharBuf is a quasi internal class. |
As I mentioned in the issue notes, the issue manifests in On Sun, Oct 18, 2015 at 10:57 PM Richard Hightower [email protected]
|
4000 bytes again... is it related to #338 ? |
Ah yes! It seems to be the same issue.
|
Please send me a test case so I can reproduce it. I reread the issue and I think I understand it better now. :) |
I have a test case in #338 |
Unlike the toString() method, the toCharArray() method does not take into account the current location.
It returns the entire buffer which is 4000 chars long.
The issue manifests in objectMapper.writeValue(Writer dest, Object value) method.
Workaround is:
JsonSerializer serializer = mapper.serializer();
CharBuf serialize = serializer.serialize(myObj);
writer.write(serialize.toString());
But this results in a copy and may affect performance.
The text was updated successfully, but these errors were encountered: