String enc = readLiteral(flags); if (!input.forceReader) input.setInputEncoding(enc);
String enc = readLiteral(flags, false);
  private void readTextDecl()    throws IOException, XMLStreamException  {    final int flags = LIT_DISABLE_CREF | LIT_DISABLE_PE | LIT_DISABLE_EREF;    requireWhitespace();    if (tryRead("version"))      {        readEq();        String v = readLiteral(flags);        if ("1.0".equals(v))          input.xml11 = false;        else if ("1.1".equals(v))          input.xml11 = true;        else          throw new XMLStreamException("illegal XML version: " + v);        requireWhitespace();      }    require("encoding");    readEq();    String enc = readLiteral(flags);    if (!input.forceReader)      input.setInputEncoding(enc);    skipWhitespace();    require("?>");  }