code: @Override
  	public void write(byte[] bytes, int off, int len) throws IOException {
  		// if httpResponse.setContentType(x) has been called with !x.contains("text/html"),
  		// then no need to continue scanning for the beforeTag
  		if (injectionCanceled) {
  			super.write(bytes, off, len);
  		} else {
  			final int index = indexOf(bytes, beforeTag, off, len);
  			if (index == -1) {
  				// beforeTag not found yet
  				super.write(bytes, off, len);
  			} else {
  				// beforeTag found: inject content.
  				super.write(bytes, off, index);
  				final String content = htmlToInject.getContent();
  				// HttpServletResponse.getCharacterEncoding() shouldn't return null according the spec
  				super.write(content.getBytes(response.getCharacterEncoding()));
  				super.write(bytes, off + index, len - index);
  			}
  		}
  	}
docs: {@inheritDoc}