Code example for HttpEntity

Methods: consumeContent, getContent

0
        try { 
            return client.execute(new HttpGet(image_url), new ResponseHandler<Bitmap>() {
                @Override 
                public Bitmap handleResponse(HttpResponse response) throws ClientProtocolException, IOException {
                    HttpEntity entity = response.getEntity();
                    Bitmap bmp = BitmapFactory.decodeStream(entity.getContent());
                    entity.consumeContent();
                    return bmp;
                } 
            }); 
        } catch (Exception e) {
            e.printStackTrace();
            return null; 
        } 
    } 
 
    private Bitmap loadBitmapFromDiskCache(String image_url) {
        Snapshot snapshot = null;
        Bitmap bmp = null;
        if (disk_image_cache != null) {
            synchronized (disk_lock) {