diff --git a/codec/src/main/java/io/netty/handler/codec/protobuf/ProtobufDecoder.java b/codec/src/main/java/io/netty/handler/codec/protobuf/ProtobufDecoder.java index 3320fc432e..8c42308ba5 100644 --- a/codec/src/main/java/io/netty/handler/codec/protobuf/ProtobufDecoder.java +++ b/codec/src/main/java/io/netty/handler/codec/protobuf/ProtobufDecoder.java @@ -20,6 +20,7 @@ import io.netty.buffer.ByteBufInputStream; import io.netty.channel.ChannelHandler.Sharable; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelPipeline; +import io.netty.handler.codec.ByteToMessageDecoder; import io.netty.handler.codec.LengthFieldBasedFrameDecoder; import io.netty.handler.codec.LengthFieldPrepender; import io.netty.handler.codec.MessageToMessageDecoder; @@ -32,7 +33,7 @@ import com.google.protobuf.MessageLite; * Decodes a received {@link ByteBuf} into a * Google Protocol Buffers * {@link Message} and {@link MessageLite}. Please note that this decoder must - * be used with a proper {@link FrameDecoder} such as {@link ProtobufVarint32FrameDecoder} + * be used with a proper {@link ByteToMessageDecoder} such as {@link ProtobufVarint32FrameDecoder} * or {@link LengthFieldBasedFrameDecoder} if you are using a stream-based * transport such as TCP/IP. A typical setup for TCP/IP would be: *
@@ -51,8 +52,7 @@ import com.google.protobuf.MessageLite;
  * and then you can use a {@code MyMessage} instead of a {@link ByteBuf}
  * as a message:
  * 
- * void messageReceived({@link ChannelHandlerContext} ctx, {@link MessageEvent} e) {
- *     MyMessage req = (MyMessage) e.getMessage();
+ * void messageReceived({@link ChannelHandlerContext} ctx, MyMessage req) {
  *     MyMessage res = MyMessage.newBuilder().setText(
  *                               "Did you say '" + req.getText() + "'?").build();
  *     ch.write(res);
diff --git a/codec/src/main/java/io/netty/handler/codec/protobuf/ProtobufEncoder.java b/codec/src/main/java/io/netty/handler/codec/protobuf/ProtobufEncoder.java
index a5cdfece63..9e654b26db 100644
--- a/codec/src/main/java/io/netty/handler/codec/protobuf/ProtobufEncoder.java
+++ b/codec/src/main/java/io/netty/handler/codec/protobuf/ProtobufEncoder.java
@@ -47,8 +47,7 @@ import com.google.protobuf.MessageLite;
  * and then you can use a {@code MyMessage} instead of a {@link ByteBuf}
  * as a message:
  * 
- * void messageReceived({@link ChannelHandlerContext} ctx, {@link MessageEvent} e) {
- *     MyMessage req = (MyMessage) e.getMessage();
+ * void messageReceived({@link ChannelHandlerContext} ctx, MyMessage req) {
  *     MyMessage res = MyMessage.newBuilder().setText(
  *                               "Did you say '" + req.getText() + "'?").build();
  *     ch.write(res);