code: public int read(char[] cbuf, int off, int len) throws IOException {
          int startPos = off;
          int currentlyRead;
          while (off - startPos < len && (currentlyRead = read()) != -1) {
              cbuf[off++] = (char) currentlyRead;
          }
          return off == startPos && len != 0 ? -1 : off - startPos;
      }
docs: Read DOCTYPE-replaced content from the wrapped Reader
  @param cbuf
  @param off
  @param len
  @return The number of characters read, or -1 if the end of the
  stream has been reached
  @throws IOException