diff --git a/src/main/java/org/jboss/netty/handler/codec/serialization/CompatibleObjectEncoder.java b/src/main/java/org/jboss/netty/handler/codec/serialization/CompatibleObjectEncoder.java index 7f22b7d6d6..cfc7fe5130 100644 --- a/src/main/java/org/jboss/netty/handler/codec/serialization/CompatibleObjectEncoder.java +++ b/src/main/java/org/jboss/netty/handler/codec/serialization/CompatibleObjectEncoder.java @@ -108,13 +108,13 @@ public class CompatibleObjectEncoder implements ChannelDownstreamHandler { writtenObjects ++; if (writtenObjects % resetInterval == 0) { oout.reset(); + buffer.discardReadBytes(); } } oout.writeObject(e.getMessage()); oout.flush(); ChannelBuffer encoded = buffer.readBytes(buffer.readableBytes()); - buffer.discardReadBytes(); write(context, e.getChannel(), e.getFuture(), encoded, e.getRemoteAddress()); }