class ResponseImpl extends Response {

    @Override
    public boolean hasEntity() {
        // per spec, need to check if the stream exists and if it has data.
        Object actualEntity = getActualEntity();
        if (actualEntity == null) {
            return false;
        } else if (actualEntity instanceof InputStream) {
            final InputStream is = (InputStream) actualEntity;
            try {
                if (is.markSupported()) {
                    is.mark(1);
                    int i = is.read();
                    is.reset();
                    return i != -1;
                } else {
                    try {
                        if (is.available() > 0) {
                            return true;
                        }
                    } catch (IOException ioe) {
                        //Do nothing
                    }
                    int b = is.read();
                    if (b == -1) {
                        return false;
                    }
                    PushbackInputStream pbis;
                    if (is instanceof PushbackInputStream) {
                        pbis = (PushbackInputStream) is;
                    } else {
                        pbis = new PushbackInputStream(is, 1);
                        if (lastEntity != null) {
                            lastEntity = pbis;
                        } else {
                            entity = pbis;
                        }
                    }
                    pbis.unread(b);
                    return true;
                }
            } catch (IOException ex) {
                throw new ProcessingException(ex);
            }
        }
        return true;
    }

      ResponseImpl(int statusCode);
      ResponseImpl(int statusCode, Object entity);
      ResponseImpl(int statusCode, Object entity, String reasonPhrase);

}