docs: public ByteBuffer encode(Packet packet, GroupContext groupContext, ChannelContext channelContext) {
          SimplePacket helloPacket  = (SimplePacket) packet;
          byte[] body = helloPacket.getBody();
          int bodyLen = 0;
          if(body != null){
              bodyLen = body.length;
          }
  
          //Bytebuffer总长度 = 消息头+消息体的长度
          int allLen = SimplePacket.HEADER_LENGTH+bodyLen;
          //创建新的Bytebuffer
          ByteBuffer buf = ByteBuffer.allocate(allLen);
          //设置字节序
          buf.order(groupContext.getByteOrder());
          //写入消息头
          buf.putInt(bodyLen);
          //写入消息体
          if(body != null){
              buf.put(body);
          }
          return buf;
      }