code: public static final <M extends Message> ChannelInitializer<Channel> protoBuf(
        final M defaultInstance, final SimpleChannelInboundHandler<M> handler) {
      return new ChannelInitializer<Channel>() {
  
        @Override
        protected void initChannel(Channel channel) throws Exception {
          channel.pipeline().addLast("frameDecoder",
              new LengthFieldBasedFrameDecoder(10 * 1024 * 1024, 0, 4, 0, 4));
          channel.pipeline().addLast("protobufDecoder",
              new ProtobufDecoder(defaultInstance));
          channel.pipeline().addLast("frameEncoder", new LengthFieldPrepender(4));
          channel.pipeline().addLast("protobufEncoder", new ProtobufEncoder());
          channel.pipeline().addLast("applicationHandler", handler);
        }
      };
    }
docs: Returns a new channel initializer suited to encode and decode a protocol
  buffer message.
  <p/>
  <p>Message sizes over 10 MB are not supported.</p>
  <p/>
  <p>The handler will be executed on the I/O thread. Blocking operations
  should be executed in their own thread.</p>
  
  @param defaultInstance an instance of the message to handle
  @param handler the handler implementing the application logic
  @param <M> the type of the support protocol buffer message