public void addParseBuffer ( WsByteBuffer buffer ) { // increment where we're about to put the new buffer in int index = ++ this . parseIndex ; if ( null == this . parseBuffers ) { // first parse buffer to track this . parseBuffers = new WsByteBuffer [ BUFFERS_INITIAL_SIZE ] ; this . parseBuffersStartPos = new int [ BUFFERS_INITIAL_SIZE ] ; for ( int i = 0 ; i < BUFFERS_INITIAL_SIZE ; i ++ ) { this . parseBuffersStartPos [ i ] = HeaderStorage . NOTSET ; } } else if ( index == this . parseBuffers . length ) { // grow the array int size = index + BUFFERS_MIN_GROWTH ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Increasing parse buffer array size to " + size ) ; } WsByteBuffer [ ] tempNew = new WsByteBuffer [ size ] ; System . arraycopy ( this . parseBuffers , 0 , tempNew , 0 , index ) ; this . parseBuffers = tempNew ; int [ ] posNew = new int [ size ] ; System . arraycopy ( this . parseBuffersStartPos , 0 , posNew , 0 , index ) ; for ( int i = index ; i < size ; i ++ ) { posNew [ i ] = HeaderStorage . NOTSET ; } this . parseBuffersStartPos = posNew ; } this . parseBuffers [ index ] = buffer ; }
Save a reference to a new buffer with header parse information . This is not part of the created list and will not be released by this message class .