0

I am using classes which came from json.org. Using them, can someone suggest a sniplet of the code which would let one parse the input stream to see whether it represents a valid json file.

1 Answer 1

3

Just use the JSONObject constructor and it throws JSONException if the source string is not proper JSON formatted String.

Sign up to request clarification or add additional context in comments.

1 Comment

Excellent. Thank you so much. Such an obvious thing .. completely escaped me

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.