{"action":"opened","issue":{"url":"https://api.github.com/repos/boonproject/boon/issues/340","labels_url":"https://api.github.com/repos/boonproject/boon/issues/340/labels{/name}","comments_url":"https://api.github.com/repos/boonproject/boon/issues/340/comments","events_url":"https://api.github.com/repos/boonproject/boon/issues/340/events","html_url":"https://github.com/boonproject/boon/issues/340","id":111507530,"number":340,"title":"org.boon.primitive.CharBuf.toCharArray() returns data followed by unexpected characters","user":{"login":"har-ki","id":9039086,"avatar_url":"https://avatars.githubusercontent.com/u/9039086?v=3","gravatar_id":"","url":"https://api.github.com/users/har-ki","html_url":"https://github.com/har-ki","followers_url":"https://api.github.com/users/har-ki/followers","following_url":"https://api.github.com/users/har-ki/following{/other_user}","gists_url":"https://api.github.com/users/har-ki/gists{/gist_id}","starred_url":"https://api.github.com/users/har-ki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/har-ki/subscriptions","organizations_url":"https://api.github.com/users/har-ki/orgs","repos_url":"https://api.github.com/users/har-ki/repos","events_url":"https://api.github.com/users/har-ki/events{/privacy}","received_events_url":"https://api.github.com/users/har-ki/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-14T22:33:31Z","updated_at":"2015-10-14T22:33:31Z","closed_at":null,"body":"Unlike the toString() method, the toCharArray() method does not take into account the current location.\r\nIt returns the entire buffer which is 4000 chars long.\r\n\r\nThe issue manifests in objectMapper.writeValue(Writer dest, Object value) method.\r\n\r\nWorkaround is:\r\n\r\nJsonSerializer serializer = mapper.serializer();\r\nCharBuf serialize = serializer.serialize(myObj);\r\nwriter.write(serialize.toString());\r\n\r\n\r\nBut this results in a copy and may affect performance."}}