private void processCompleteData ( ) throws ProtocolException { WsByteBufferPoolManager bufManager = HttpDispatcher . getBufferManager ( ) ; WsByteBuffer buf = bufManager . allocate ( getByteCount ( dataPayload ) ) ; for ( byte [ ] bytes : dataPayload ) { buf . put ( bytes ) ; } buf . flip ( ) ; if ( expectedContentLength != - 1 && buf . limit ( ) != expectedContentLength ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "processCompleteData release buffer and throw ProtocolException" ) ; } buf . release ( ) ; ProtocolException pe = new ProtocolException ( "content-length header did not match the expected amount of data received" ) ; pe . setConnectionError ( false ) ; // stream error throw pe ; } moveDataIntoReadBufferArray ( buf ) ; }
Put the data payload for this stream into the read buffer that will be passed to the webcontainer . This should only be called when this stream has received an end of stream flag .