Hello, I implemented CumulativeProtocolDecoder.doDecode() in my subclass of CumulativeProtocolDecoder. In my doDecode(), the most straight-forward way I could figure out of decoding data is reading fields(Integers, Bytes, Booleans, etc.) of my POJO step by step following the protocol, until the work is done or an java.nio.BufferUnderflowException is thrown, which means data not sufficient for decoding. In the later case, I reset the ByteBuffer to the previous position before invocation of doDecode().
So I keep thinking that this exception handling aspect should be done by a super class of many real-protocol concerned decoders, maybe the CumulativeProtocolDecoder itself. Here's a example patch to describe my idea: http://www.nabble.com/file/p12938622/CPD.patch CPD.patch Thanks. -- View this message in context: http://www.nabble.com/CumulativeProtocolDecoder-records-the-previous-position-of-Bytebuffer-tf4533829s16868.html#a12938622 Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.