title: Read and Write strings via ByteBuf using byte[] array
body: <p>I'm trying to send a string through netty with a ByteBuf.
  First of all I convert the string to a byte array like that:</p>
  
  <pre><code>byteBuf.writeInt(this.serverName.length());
  byteBuf.writeInt(this.ipAdress.length());
  
  byteBuf.writeBytes(this.serverName.getBytes(StandardCharsets.UTF_8));
  byteBuf.writeBytes(this.ipAdress.getBytes(StandardCharsets.UTF_8));
  </code></pre>
  
  <p>This works well, but I don't know how to read the bytes to convert them back to the string?</p>
  
  <p>I tried something like that:</p>
  
  <pre><code>int snLen = byteBuf.readInt();
  int ipLen = byteBuf.readInt();
  
  byte[] bytes = new byte[byteBuf.readableBytes()];
  
  System.out.println(byteBuf.readBytes(bytes).readByte());
  this.ipAdress = "";
  </code></pre>
  
  <p>There must be something to get the bytes back. You can send bytes from a string but can't get the bytes back at the end? Seems like there is a method for that, but I don't have an idea how to do that.</p>
  
  <p>I hope anyone from you can help me.
  Thanks in advance! :)</p>