if ("chunked".equalsIgnoreCase(transferCoding))
if ("HEAD".equals(method) || !mayHaveBody) {  in = new LimitedLengthInputStream(in, 0, true, connection, doClose); } else if ("chunked".equalsIgnoreCase(transferCoding))
  private InputStream createResponseBodyStream(Headers responseHeaders,                                               int majorVersion,                                               int minorVersion,                                               InputStream in)    throws IOException  {    long contentLength = -1;    Headers trailer = null;        // Persistent connections are the default in HTTP/1.1    boolean doClose = "close".equalsIgnoreCase(getHeader("Connection")) ||      "close".equalsIgnoreCase(responseHeaders.getValue("Connection")) ||      (connection.majorVersion == 1 && connection.minorVersion == 0) ||      (majorVersion == 1 && minorVersion == 0);    String transferCoding = responseHeaders.getValue("Transfer-Encoding");    if ("chunked".equalsIgnoreCase(transferCoding))      {        in = new LimitedLengthInputStream(in, -1, false, connection, doClose);                  in = new ChunkedInputStream(in, responseHeaders);      }     else      {        contentLength = responseHeaders.getLongValue("Content-Length");        if (contentLength < 0)          doClose = true;  // No Content-Length, must close.        in = new LimitedLengthInputStream(in, contentLength,                                          contentLength >= 0,                                          connection, doClose);      }    String contentCoding = responseHeaders.getValue("Content-Encoding");    if (contentCoding != null && !"identity".equals(contentCoding))      {        if ("gzip".equals(contentCoding))          {            in = new GZIPInputStream(in);          }        else if ("deflate".equals(contentCoding))          {            in = new InflaterInputStream(in);          }        else          {            throw new ProtocolException("Unsupported Content-Encoding: " +                                        contentCoding);          }	// Remove the Content-Encoding header because the content is	// no longer compressed.	responseHeaders.remove("Content-Encoding");      }    return in;  }