code: public void setChunkedEncoding() throws IOException {
  		validate();
  		// peek ahead and make sure we have a line with hex numbers:
  		int max = 50;
  		is.mark(max + 2);
  		int cur = 0;
  		int hexFound = 0;
  		boolean isChunked = false;
  		while (cur < max) {
  			int nextC = is.read();
  			// allow CRLF and plain ole LF:
  			if ((nextC == 13) || (nextC == 10)) {
  				// must have read at least 1 hex char:
  				if (hexFound > 0) {
  					if (nextC == 10) {
  						isChunked = true;
  						break;
  					}
  					nextC = is.read();
  					if (nextC == 10) {
  						isChunked = true;
  						break;
  					}
  				}
  				// keep looking to allow some blank lines.
  			} else {
  				// better be a hex character:
  				if (isHex(nextC)) {
  					hexFound++;
  				} else if (nextC != ' ') {
  					// allow whitespace before or after chunk...
  					// not a hex digit: not a chunked stream.
  					break;
  				}
  			}
  			cur++;
  		}
  		is.reset();
  		if (isChunked) {
  			setInputStream(new ChunkedInputStream(is));
  		}
  	}
docs: indicate that there is a {@code Transfer-Encoding: chunked} header, so the input
  data should be dechunked as it is read. This method actually peeks
  ahead to verify that there is a hex-encoded chunk length before
  assuming the data is chunked.
  @throws IOException for usual reasons