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
+1

> Am 21.07.2014 um 20:47 schrieb Trustin Lee <notifications@github.com>:
> 
> In codec/src/main/java/io/netty/handler/codec/MessageToBufferedByteEncoder.java:
> 
> > + * You should use this {@link MessageToBufferedByteEncoder} if you expect to either write messages in multiple parts
> > + * or if the used protocol supports PIPELINING.
> > + *
> > + * Example implementation which encodes {@link Integer}s to a {@link ByteBuf}.
> > + *
> > + * <pre>
> > + *     public class IntegerEncoder extends {@link MessageToBufferedByteEncoder}&lt;{@link Integer}&gt; {
> > + *         {@code @Override}
> > + *         public void encode({@link ChannelHandlerContext} ctx, {@link Integer} msg, {@link Encoder} encoder)
> > + *                 throws {@link Exception} {
> > + *             encoder.writeInt(msg);
> > + *         }
> > + *     }
> > + * </pre>
> > + */
> > +public abstract class MessageToBufferedByteEncoder<I> extends ChannelOutboundHandlerAdapter {
> Maybe BufferredMessageToByteEncoder is better?
> 
> —
> Reply to this email directly or view it on GitHub.