title: Netty channel.write not writing message
body: <p>I'm trying to make my first steps with Netty, for this purpose I wrote simple server on Netty and simple client on oio plain TCP.</p>
  
  <p>Client sends random text packet, and must receive "Ack" message.
  See the handler method:</p>
  
  <pre><code>  @Override
  public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
  
      ctx.write("Ack"); 
      ctx.flush();
  
      ByteBuf in = (ByteBuf) msg;
      StringBuilder sb = new StringBuilder();
      try {
          while (in.isReadable()) {
              sb.append((char) in.readByte());
  
          }
      } finally {
          ReferenceCountUtil.release(msg);
      }
      LOG.debug("Incoming message. ACK was send");
  
      String myaddr = ctx.channel().remoteAddress().toString();
      String message = "Message from " + myaddr + " :" + sb.toString();
      LOG.debug(message);
      sendToOther(myaddr, message);
  
  }
  </code></pre>
  
  <p>The problem is - when I try to send back "Ack" string - client receives nothing.
  But when i try to send back message that incoming - it works fine, and i see echo in my client.</p>
  
  <pre><code> @Override
  public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
  
      ctx.write(msg); 
      ctx.flush();
  </code></pre>
  
  <p><code>write()</code> method needs <code>Object</code> and I tried to send <code>(Object) String</code> - but nothing happened.
  I also tried to send <code>ByteBuf</code> (I saw that in one article) and it's still not working too.</p>
  
  <p>When I send back the incoming message as echo - it works. When I send thomething else - it doesn't. Please help me, i just can't figure where my mistake is.</p>
  
  <hr>
  
  <p>I solved this problem. Point was, that you need to send <code>ByteBuff</code> only. So we need create it, and write something to it and only then we can write it into chanel pipe. in my case it was like :</p>
  
  <pre><code>String ack = "ACK";
      ByteBuf out = ctx.alloc().buffer(ack.length()*2);
      out.writeBytes(ack.getBytes());
      ctx.write(out); 
      ctx.flush();
      LOG.debug("Incoming message. ACK was send");
  </code></pre>
  
  <p>May be this is not exelent sollution, but it works as example.</p>