netty/netty — Issue #207: ReplayDecoder always copies to the cumulation buffer, even if unnecessary
Author: spullara
Created: 2012-02-28 22:50:59+00:00
State: open

I think we can avoid copying to the cumulation buffer until after the decode completes. If it is successful and there is no remaining data we can avoid the copy completely. In the case it is successful but fails to consume the whole buffer we can reduce the copy to the remaining bytes. In the case of a failure to decode, we can also decrease the size of the copy by starting at the current checkpoint.