Looking through the documentation and source code, I see no clear way to do this. Curious if I missed something.
Say I get an InputStream from a server response. I am creating a JsonParser from this InputStream. The server response is expected to contain text containing valid json, for example:
{"iamValidJson":"yay"}
However, if the response ends up as invalid json or not json at all, for example:
Some text that is not json
JsonParser ultimately throws an exception. In this case, I would like to extract the main invalid text " Some text that is not json " from JsonParser so that it can be used for other purposes.
I can't get it out of InputStream because it doesn't support dumping, and JsonParser creation uses it.
Is there any way to do this?
java json android jackson inputstream
cottonBallPaws May 30 '13 at 12:04 a.m.
source share