Le 29 juil. 2012 21:30, "ನಾಗೇಶ್ ಸುಬ್ರಹ್ಮಣ್ಯ (Nagesh S)" < [email protected]> a écrit : > > Hi Emmanuel, > When the decode object gets control with the IoBuffer object, because a > NEED_DATA was triggered, does the new IoBuffer object have the older data > pre-pended to the recently read data ?
yes. > > For example, I am expecting 100 bytes of data of which I have received 30 > bytes now. So, I trigger NEED_DATA. Will the subsequent invocation of > decode have the IoBuffer object with 100 bytes or 30 bytes data ? yes. > > In my debugging attempts, I see that, it is 100. However, the log messages > seem to show 30 and 70 separately. For example, in the log excerpt below, I > see, 4096 and 1123 bytes of message and in my debug trace, I see the new > IoBuffer to have a limit of 5229 (=4096+1123). The logging filter works on the raw data. It sees only 70 bytes, has it does not know about the cumulative buffer being used inside the decoder. > > 161589 [NioProcessor-2] INFO org.apache.mina.filter.logging.LoggingFilter - > RECEIVED: HeapBuffer[pos=0 lim=4096 cap=4096: ...] > 176231 [NioProcessor-2] INFO org.apache.mina.filter.logging.LoggingFilter - > RECEIVED: HeapBuffer[pos=0 lim=1123 cap=8192: ...] > > ನಾಗೇಶ್ > > > On Fri, Jul 27, 2012 at 1:09 AM, ನಾಗೇಶ್ ಸುಬ್ರಹ್ಮಣ್ಯ (Nagesh S) < > [email protected]> wrote: > > > Hi Emmanuel, > > Thanks for the explanation. > > > > I guess, I will have to use the IoSession object to save an attribute to > > denote that a particular iteration of decoding was 'fresh' or a result of > > NEED_DATA. > > > > ನಾಗೇಶ್ > >
