protected JSONObject readInputStream(InputStream is) throws IOException {
  String jsonString=readStreamToString(is);
  JSONObject jsonObject;
  try {
    return new JSONObject(jsonString);
  }
 catch (  JSONException error) {
    throw new IOException(error.toString());
  }
}

protected JSONObject readInputStream ( InputStream is ) throws IOException { String jsonString = readStreamToString ( is ) ; JSONObject jsonObject ; try { return new JSONObject ( jsonString ) ; } catch ( JSONException error ) { throw new IOException ( error . toString ( ) ) ; } }
helper method to read an http response .
