// Make sure the resulting cumulation buffer has no more than the configured components.
CompositeChannelBuffer composite = (CompositeChannelBuffer) cumulation;
if (composite.numComponents() >= maxCumulationBufferComponents) {
currentMessage.setContent(ChannelBuffers.wrappedBuffer(composite.copy(), input));
} else {
List<ChannelBuffer> decomposed = composite.decompose(0, composite.readableBytes());
ChannelBuffer[] buffers = decomposed.toArray(new ChannelBuffer[decomposed.size() + 1]);
buffers[buffers.length - 1] = input;
currentMessage.setContent(ChannelBuffers.wrappedBuffer(buffers));
}