private WsByteBuffer [ ] marshallAddedHeaders ( WsByteBuffer [ ] inBuffers , int index ) { WsByteBuffer [ ] buffers = inBuffers ; buffers [ index ] = allocateBuffer ( this . outgoingHdrBufferSize ) ; for ( HeaderElement elem = this . hdrSequence ; null != elem ; elem = elem . nextSequence ) { if ( elem . wasAdded ( ) ) { buffers = marshallHeader ( buffers , elem ) ; } } // add second EOL buffers = putBytes ( BNFHeaders . EOL , buffers ) ; buffers = flushCache ( buffers ) ; // flip the last buffer now that we're done buffers [ buffers . length - 1 ] . flip ( ) ; return buffers ; }
Marshall the newly added headers from the sequence list to the output buffers starting at the input index on the list .