Code example for HttpEntity

Methods: consumeContent

0
				int nStateCode = objResponse.getStatusLine().getStatusCode();
				HttpEntity httpEntity = objResponse.getEntity();
				byte[] arrayOfByte = null;
				if (nStateCode / 100 == 2)
					arrayOfByte = EntityUtils.toByteArray(httpEntity);
				httpEntity.consumeContent();
				String strResponse = new String(arrayOfByte, "UTF-8");
				jsonObject = new JSONObject(strResponse);
				this.lat = jsonObject.getJSONObject("location").getDouble(
						"latitude"); 
				this.lng = jsonObject.getJSONObject("location").getDouble(
						"longitude"); 
				this.accuracy = jsonObject.getJSONObject("location").getInt(
						"accuracy"); 
				; 
			} catch (Exception localException) {
				return null; 
			} 
			return null; 
		} 
Contextual code suggestions in your IDE  Get Codota for Java