*/
public void writeTo(final OutputStream outputStream) throws IOException {
if (this.httpResponse != null && this.currentRequest != null) {
final HttpEntity httpEntity = this.httpResponse.getEntity();
if (httpEntity != null) try {
httpEntity.writeTo(outputStream);
outputStream.flush();
// Ensures that the entity content is fully consumed and the content stream, if exists, is closed.
EntityUtils.consume(httpEntity);
ConnectionInfo.removeConnection(this.currentRequest.hashCode());
this.currentRequest = null;