docs: private void parseCharData() throws Exception {
          char c;
          int state = 0;
          boolean pureWhite = false;
  
          // assert (dataBufferPos == 0);
  
          // are we expecting pure whitespace? it might be dirty...
          if ((currentElementContent == CONTENT_ELEMENTS)
                  && !isDirtyCurrentElement) {
              pureWhite = true;
          }
  
          // always report right out of readBuffer
          // to minimize (pointless) buffer copies
          while (true) {
              int i;
  
              loop: for (i = readBufferPos; i < readBufferLength; i++) {
                  advanceLocation();
                  switch (c = readBuffer[i]) {
                      case '\n':
                          nextCharOnNewLine = true;
                          // pureWhite unmodified
                          break;
                      case '\r': // should not happen!!
                      case '\t':
                      case ' ':
                          // pureWhite unmodified
                          break;
                      case '&':
                      case '<':
                          // pureWhite unmodified
                          // CLEAN end of text sequence
                          state = 1;
                          rollbackLocation();
                          break loop;
                      case ']':
                          // that's not a whitespace char, and
                          // can not terminate pure whitespace either
                          pureWhite = false;
                          // Refill buffer if needed -- 2008-03-06 hsivonen
                          if (readBufferOverflow == -1) {
                              if ((i + 2) >= readBufferLength) {
                                  reportText(pureWhite, i);
                                  readBufferOverflow = ']';
                                  fillBuffer();
                                  i = readBufferPos;
                              }
                              if ((readBuffer[i + 1] == ']')
                                      && (readBuffer[i + 2] == '>')) {
                                  // ERROR end of text sequence
                                  state = 2;
                                  rollbackLocation();
                                  break loop;
                              }
                          }
                          break;
                      default:
                          if (((c < 0x0020) || (c > 0xFFFD))
                                  || ((c >= 0x007f) && (c <= 0x009f)
                                          && (c != 0x0085) && (xmlVersion == XML_11))) {
                              fatal("illegal XML character U+"
                                      + Integer.toHexString(c));
                          } else if ((c >= '\u007F') && (c <= '\u009F')) // 2006-04-25
                          // hsivonen
                          {
                              handler.warn("Saw a control character: U+00"
                                      + Integer.toHexString(c) + ".");
                          }
                          // that's not a whitespace char
                          pureWhite = false;
                  }
              }
              // report characters/whitspace
              reportText(pureWhite, i);
  
              if (state != 0) {
                  break;
              }
  
              // fill next buffer from this entity, or
              // pop stack and continue with previous entity
              unread(readCh());
          }
          if (!pureWhite) {
              isDirtyCurrentElement = true;
          }
          // finish, maybe with error
          if (state != 1) // finish, no error
          {
              fatal("character data may not contain ']]>'");
          }
      }