boolean hex = (c == 'x');
boolean hex = (c == 0x78);
  private int readCharData(String prefix)    throws IOException, XMLStreamException  {    boolean white = true;    buf.setLength(0);    if (prefix != null)      buf.append(prefix);    boolean done = false;    boolean entities = false;    //System.out.println("readCharData input="+input.name+" line="+input.line+" col="+input.column);    while (!done)      {        // Block read        mark(tmpBuf.length);        int len = read(tmpBuf, 0, tmpBuf.length);        if (len == -1)          {            if (inputStack.size() > 1)              {                popInput();                // report end-entity                done = true;              }            else              throw new EOFException();          }        for (int i = 0; i < len && !done; i++)          {            char c = tmpBuf[i];            switch (c)              {              case ' ':              case '\t':              case '\n':              case '\r':                buf.append(c);                break; // whitespace              case '&':                reset();                read(tmpBuf, 0, i);                // character reference?                mark(3);                c = readCh(); // &                c = readCh();                if (c == '#')                  {                    mark(1);                    c = readCh();                    boolean hex = (c == 'x');                    if (!hex)                      reset();                    char[] ch = readCharacterRef(hex ? 16 : 10);                    buf.append(ch, 0, ch.length);                    for (int j = 0; j < ch.length; j++)                      {                        switch (ch[j])                          {                          case ' ':                          case '\t':                          case '\n':                          case '\r':                            break; // whitespace                          default:                            white = false;                          }                      }                  }                else                  {                    // entity reference                    reset();                    c = readCh(); // &                    String entityName = readNmtoken(true);                    require(';');                    String text =                      (String) PREDEFINED_ENTITIES.get(entityName);                    if (text != null)                      buf.append(text);                    else                      {                        //if (replaceERefs)                        //  expandEntity(entityName, false); //report start-entity                        //else                        //  reset(); // report reference                        pushInput("", "&" + entityName + ";");                        done = true;                        break;                      }                  }                // continue processing                i = -1;                mark(tmpBuf.length);                len = read(tmpBuf, 0, tmpBuf.length);                if (len == -1)                  {                    if (inputStack.size() > 1)                      {                        popInput();                        done = true;                      }                    else                      throw new EOFException();                  }                entities = true;                break; // end of text sequence              case '>':                int l = buf.length();                if (l > 1 &&                    buf.charAt(l - 1) == ']' &&                    buf.charAt(l - 2) == ']')                  error("Character data may not contain unescaped ']]>'");                buf.append(c);                break;              case '<':                reset();                read(tmpBuf, 0, i);                done = true;                break; // end of text sequence              default:                if ((c < 0x0020 || c > 0xfffd) ||                    (input.xml11 && (c >= 0x007f) &&                     (c <= 0x009f) && (c != 0x0085)))                  {                    error("illegal XML character",                          "U+" + Integer.toHexString(c));                  }                white = false;                buf.append(c);              }          }        // if text buffer >= 2MB, return it as a chunk        // to avoid excessive memory use        if (!coalescing && buf.length() >= 2097152)          done = true;      }    if (entities)      normalizeCRLF(buf);    return white ? XMLStreamConstants.SPACE : XMLStreamConstants.CHARACTERS;  }