@Override
    public void close() throws XMLStreamException
    {
        if (mParseState != STATE_CLOSED) {
            mParseState = STATE_CLOSED;
            /* Let's see if we should notify factory that symbol table
             * has new entries, and may want to reuse this symbol table
             * instead of current root.
             */
            if (mCurrToken != END_DOCUMENT) {
                mCurrToken = mSecondaryToken = END_DOCUMENT;
                if (mSymbols.isDirty()) {
                    mOwner.updateSymbolTable(mSymbols);
                }
            }
            /* Hmmh. Actually, we need to close all the dependant input
             * sources, first, and then also call close() 
             * on the root input source object; it
             * will only do real close if that was enabled earlier.
             * The root input source also prevents multiple close() calls
             * for the underlying source, so we need not check that here.
             */
            closeAllInput(false);
            // And finally, can now recycle low-level (text) buffers
            mTextBuffer.recycle(true);
        }
    }
@ Override public void close ( ) throws XMLStreamException { if ( mParseState != STATE_CLOSED ) { mParseState = STATE_CLOSED ; if ( mCurrToken != END_DOCUMENT ) { mCurrToken = mSecondaryToken = END_DOCUMENT ; if ( mSymbols . isDirty ( ) ) { mOwner . updateSymbolTable ( mSymbols ) ; } } closeAllInput ( false ) ; mTextBuffer . recycle ( true ) ; } }
<p>
Note: as per StAX 1.0 specs, this method does NOT close the underlying
input reader. That is, unless the new StAX2 property
{@link org.codehaus.stax2.XMLInputFactory2#P_AUTO_CLOSE_INPUT} is
set to true.