code: protected final int doReadBytes(ByteBuf byteBuf) throws Exception {
          int writerIndex = byteBuf.writerIndex();
          int localReadAmount;
          unsafe().recvBufAllocHandle().attemptedBytesRead(byteBuf.writableBytes());
          if (byteBuf.hasMemoryAddress()) {
              localReadAmount = socket.readAddress(byteBuf.memoryAddress(), writerIndex, byteBuf.capacity());
          } else {
              ByteBuffer buf = byteBuf.internalNioBuffer(writerIndex, byteBuf.writableBytes());
              localReadAmount = socket.read(buf, buf.position(), buf.limit());
          }
          if (localReadAmount > 0) {
              byteBuf.writerIndex(writerIndex + localReadAmount);
          }
          return localReadAmount;
      }
docs: Read bytes into the given {@link ByteBuf} and return the amount.