title: Reading binary data from TCP clients using Netty
body: <p>I'm trying  get byte data from TCP client applications. Following the documentation of Netty project I found this code and use it in my system:</p>
  <pre><code>ServerBootstrap b = new ServerBootstrap();
        b.group(bossGroup, workerGroup)
              .channel(NioServerSocketChannel.class)
              .option(ChannelOption.SO_KEEPALIVE, true)
              .handler(new LoggingHandler(LogLevel.INFO))
              .childHandler(new ChannelInitializer&lt;SocketChannel&gt;() {
    
                   @Override
                   public void initChannel(SocketChannel ch) throws Exception {
                     ChannelPipeline p = ch.pipeline();
                     p.addLast(&quot;frameDecoder&quot;, new LengthFieldBasedFrameDecoder(1048576, 0, 4, 0, 4));
                     p.addLast(&quot;bytesDecoder&quot;, new ByteArrayDecoder());
                     p.addLast(new ServerHandler());
                              
                     }
          }); 
  </code></pre>
  <p>But in my <code>ServerHandler</code> class I'm unable to find and call the method:</p>
  <pre><code>void channelRead (ChannelHandlerContext ctx, byte[] bytes){}
  </code></pre>
  <p>instead of the typical:</p>
  <pre><code>void channelRead (ChannelHandlerContext ctx, Object msg){}
  </code></pre>
  <p>Thanks in advance!</p>