code: public int readInt(byte []buf, int offset, int length) throws IOException
    {
      if (! _didGet) {
        getConnInput();
      }
  
      if (_isRequestDone) {
        return -1;
      }
  
      try {
        int len = length;
  
        if (_isChunked) {
          if (_chunkLength == 0) {
            int ch;
  
            for (ch = _rs.read();
                 ch >= 0 && (ch == '\r' || ch == '\n' || ch == ' ');
                 ch = _rs.read()) {
            }
          
            for (; ch >= 0 && ch != '\n'; ch = _rs.read()) {
              if (ch >= '0' && ch <= '9')
                _chunkLength = 16 * _chunkLength + ch - '0';
              else if (ch >= 'a' && ch <= 'f')
                _chunkLength = 16 * _chunkLength + ch - 'a' + 10;
              else if (ch >= 'A' && ch <= 'F')
                _chunkLength = 16 * _chunkLength + ch - 'A' + 10;
            }
  
            if (_chunkLength == 0) {
              _isRequestDone = true;
              return -1;
            }
          }
          else if (_chunkLength < 0)
            return -1;
        
          if (_chunkLength < len)
            len = _chunkLength;
        }
        else if (_contentLength < 0) {
        }
        else if (_contentLength == 0) {
          _isRequestDone = true;
          return -1;
        }
        else if (_contentLength < len)
          len = _contentLength;
  
        len = _rs.read(buf, offset, len);
  
        if (len < 0) {
        }
        else if (_isChunked)
          _chunkLength -= len;
        else if (_contentLength > 0)
          _contentLength -= len;
  
        return len;
      } catch (IOException e) {
        _isKeepalive = false;
        throw e;
      } catch (RuntimeException e) {
        _isKeepalive = false;
        throw e;
      }
    }
docs: Read data from the connection.  If the request hasn't yet been sent
  to the server, send it.