protected String parseLocalName(char c)
        throws XMLStreamException
    {
        /* Has to start with letter, or '_' (etc); we won't allow ':' as that
         * is taken as namespace separator; no use trying to optimize
         * heavily as it's 98% likely it is a valid char...
         */
        if (!isNameStartChar(c)) {
            if (c == ':') {
                throwUnexpectedChar(c, " (missing namespace prefix?)");
            }
            throwUnexpectedChar(c, " (expected a name start character)");
        }

        int ptr = mInputPtr;
        int hash = c;
        final int inputLen = mInputEnd;
        int startPtr = ptr-1; // already read previous char
        final char[] inputBuf = mInputBuffer;

        /* After which there may be zero or more name chars
         * we have to consider
         */
        while (true) {
            if (ptr >= inputLen) {
                /* Ok, identifier may continue past buffer end, need
                 * to continue with part 2 (separate method, as this is
                 * not as common as having it all in buffer)
                 */
                mInputPtr = ptr;
                return parseLocalName2(startPtr, hash);
            }
            // Ok, we have the char... is it a name char?
            c = inputBuf[ptr];
            if (c < CHAR_LOWEST_LEGAL_LOCALNAME_CHAR) {
                break;
            }
            if (!isNameChar(c)) {
                break;
            }
            hash = (hash * 31) + c;
            ++ptr;
        }
        mInputPtr = ptr;
        return mSymbols.findSymbol(mInputBuffer, startPtr, ptr - startPtr, hash);
    }
protected String parseLocalName ( char c ) throws XMLStreamException { if ( ! isNameStartChar ( c ) ) { if ( c == ':' ) { throwUnexpectedChar ( c , " (missing namespace prefix?)" ) ; } throwUnexpectedChar ( c , " (expected a name start character)" ) ; } int ptr = mInputPtr ; int hash = c ; final int inputLen = mInputEnd ; int startPtr = ptr - 1 ; final char [ ] inputBuf = mInputBuffer ; while ( true ) { if ( ptr >= inputLen ) { mInputPtr = ptr ; return parseLocalName2 ( startPtr , hash ) ; } c = inputBuf [ ptr ] ; if ( c < CHAR_LOWEST_LEGAL_LOCALNAME_CHAR ) { break ; } if ( ! isNameChar ( c ) ) { break ; } hash = ( hash * 31 ) + c ; ++ ptr ; } mInputPtr = ptr ; return mSymbols . findSymbol ( mInputBuffer , startPtr , ptr - startPtr , hash ) ; }
Method that will parse name token (roughly equivalent to XML specs;
although bit lenier for more efficient handling); either uri prefix,
or local name.
<p>
Much of complexity in this method has to do with the intention to
try to avoid any character copies. In this optimal case algorithm
would be fairly simple. However, this only works if all data is
already in input buffer... if not, copy has to be made halfway
through parsing, and that complicates things.
<p>
One thing to note is that String returned has been canonicalized
and (if necessary) added to symbol table. It can thus be compared
against other such (usually id) Strings, with simple equality operator.

@param c First character of the name; not yet checked for validity

@return Canonicalized name String (which may have length 0, if
EOF or non-name-start char encountered)