Reputation: 96371
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.
Upvotes: 0
Views: 705
Reputation: 5602
Just use the JSONObject constructor and it throws JSONException if the source string is not proper JSON formatted String.
Upvotes: 3