Here I am trying to get Json data from URL. But oit is displaying only partial data. Below are the details how I am reading the data
BufferedInputStream is;
HttpGet httpGet = new HttpGet(url);
httpGet.addHeader("Accept", "application/json");
HttpResponse httpResponse = getHttpClient().execute(httpGet);
HttpEntity httpEntity = httpResponse.getEntity();
is = new BufferedInputStream(httpEntity.getContent()) ;
public void getJsonwithByteArray(BufferedInputStream istream) {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
int ctr;
try {
ctr = istream.read();
while (ctr != -1) {
byteArrayOutputStream.write(ctr);
ctr = istream.read();
}
istream.close();
} catch (IOException e) {
e.printStackTrace();
}
Log.v("Text Data", byteArrayOutputStream.toString());
try {
// Parse the data into jsonobject to get original data in form of
// json.
JSONObject jObject = new JSONObject(
byteArrayOutputStream.toString());
jObj = jObject;
Log.v("JsonParser", "JsonByteArry data: " + jObj.toString());
} catch (Exception e) {
e.printStackTrace();
}
}