Here is the core decoding code:

 

for (;;) {
            IoBuffer b = undecodedBuffers.peek();
            if (b == null) {
                break;
            }

            int oldRemaining = b.remaining();
            state.decode(b, out);
            int newRemaining = b.remaining();
            if (newRemaining != 0) {
                if (oldRemaining == newRemaining) {
                    throw new IllegalStateException(
                            DecodingState.class.getSimpleName() + " must " +
                            "consume at least one byte per decode().");
                }
            } else {
                undecodedBuffers.poll();
            }
}

 

My question is: what's gonna happen when the current buffer has only 2 bytes 
but the "state" needs 4 bytes to decode? the state can't consume 1 byte so an 
IllegalStateException will be thrown out?
                                          
_________________________________________________________________
Hotmail: Free, trusted and rich email service.
https://signup.live.com/signup.aspx?id=60969

Reply via email to