https://stackoverflow.com/questions/6955657/ I read this question . But i don't want to upload my file . Because the content is from my client so i cannot upload it without permissions. so i want to check it locally. I have written a java program , it takes too much of time to read 37mb file . But it didn't get succeeded . My program is
try
{
new JSONObject(filecontent);
System.out.println("valid file");
}
catch(JSONException ex)
{
System.out.println("Invalid file");
}
{
try
{
new JSONArray(filecontent);
System.out.println("valid file");
}
catch(JSONException ex)
{
System.out.println("Invalid file");
}
}
But i googled it to do it quickly . Does php [with the help of file_get_contents and json_decode] give better solution or can i implement it in java itself? please help me to do it locally quickly.