code: public void validateText(XMLValidator vld, boolean lastSegment)
          throws XMLStreamException
      {
          // Shared buffer? Let's just pass that
          if (mInputStart >= 0) {
              vld.validateText(mInputBuffer, mInputStart, mInputStart + mInputLen, lastSegment);
          } else {
              /* Otherwise, can either create a combine buffer, or construct
               * a String. While former could be more efficient, let's do latter
               * for now since current validator implementations work better
               * with Strings.
               */
              vld.validateText(contentsAsString(), lastSegment);
          }
      }
docs: /*
  ////////////////////////////////////////////
  Support for validation
  ////////////////////////////////////////////