JSONTokener tokener = null;
try {
tokener = new JSONTokener(br);
/* check that the JSON is well-formed by starting with a '{' */
if (tokener.nextClean() != START_OBJECT) {
LOG.error(String.format("A JSONObject text must begin with '%c'",
START_OBJECT));
}
/* loop on the whole array */