Buffered encoder 4.0

Introduce a new abstract codec called MessageToBufferedByteEncoder which allows to buffer written data into one buffer.

Using the sub-class in protocols that allows for pipelining or for cases where the messages are made out of multiple parts can improve performance a lot. To show this HTTP was moved over to use the MessageToBufferedByteEncoder which shows a large performance improvement
Sure

> Am 21.07.2014 um 20:42 schrieb Trustin Lee <notifications@github.com>:
> 
> In codec/src/main/java/io/netty/handler/codec/MessageToBufferedByteEncoder.java:
> 
> > +     * Do nothing by default, sub-classes may override this method.
> > +     */
> > +    protected void handlerRemoved0(@SuppressWarnings("unused")ChannelHandlerContext ctx) throws Exception {
> > +        // NOOP
> > +    }
> > +
> > +    /**
> > +     * Encode a message into a {@link ByteBuf}. This method will be called for each written message that can be handled
> > +     * by this encoder.
> > +     *
> > +     * @param ctx           the {@link ChannelHandlerContext} which this {@link MessageToByteEncoder} belongs to
> > +     * @param msg           the message to encode
> > +     * @param out           the {@link Encoder} into which the encoded message will be written
> > +     * @throws Exception    is thrown if an error accour
> > +     */
> > +    protected abstract void encode(ChannelHandlerContext ctx, I msg, Encoder out) throws Exception;
> Perhaps we could use ByteWriter instead of Encoder here and keep Encoder hidden? We could just add basic writeFileRegion() implementation to AbstractByteBuf or somewhere else.
> 
> —
> Reply to this email directly or view it on GitHub.