I am trying to read a text file with JSON data in it using Java.
I use the following lines of code:
InputStream is = new FileInputStream(fileName);
JSONObject ret;
try {
s = IOUtils.toString(is);
ret = (JSONObject)JSONSerializer.toJSON(s);
}
I however, am not able to get the JSON value in the ret variable and I in fact get a null value in the String 's'. Is there something that I am overlooking here?
I would greatly appreciate any help.