/** * Reads next character or throws an exception if all bytes have been read. * * @return next character * @throws IOException I/O exception */ private int consume() throws IOException { while (true) { final int ch = input.read(); if (ch == -1) return 0; if (ch == '%' && pe) { // [69] final byte[] key = name(true); final byte[] val = pents.get(key); if (val == null) error(UNKNOWNPE, key); check(';'); input.add(val, true); } else { return ch; } } }