public void addToCreatedBuffer ( WsByteBuffer buffer ) { // increment where we're about to put the new buffer in int index = ++ this . createdIndex ; if ( null == this . myCreatedBuffers ) { // first allocation this . myCreatedBuffers = new WsByteBuffer [ BUFFERS_INITIAL_SIZE ] ; } else if ( index == this . myCreatedBuffers . length ) { // grow the array int size = index + BUFFERS_MIN_GROWTH ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Increasing created buffer array size to " + size ) ; } WsByteBuffer [ ] tempNew = new WsByteBuffer [ size ] ; System . arraycopy ( this . myCreatedBuffers , 0 , tempNew , 0 , index ) ; this . myCreatedBuffers = tempNew ; } this . myCreatedBuffers [ index ] = buffer ; }
Add a buffer on the list that will be manually released later .