docs: ByteBuffer[] encode(final Supplier<ByteBuffer> supplier, final Consumer<ByteBuffer> consumer, final Cryptor cryptor) {
          final byte opcode = (byte) (this.type.getValue() | 0x80);
          if (this.sendConvert != null) {
              Supplier<ByteBuffer> newsupplier = new Supplier<ByteBuffer>() {
  
                  private ByteBuffer buf = supplier.get();
  
                  @Override
                  public ByteBuffer get() {
                      if (buf != null) {
                          ByteBuffer rs = buf;
                          rs.position(6);
                          this.buf = null;
                          return rs;
                      }
                      return supplier.get();
                  }
              };
              ByteBuffer[] buffers = this.sendMapconvable ? this.sendConvert.convertMapTo(newsupplier, (Object[]) sendJson) : this.sendConvert.convertTo(newsupplier, sendJson);
              if (cryptor != null) buffers = cryptor.encrypt(buffers, supplier, consumer);
              int len = 0;
              for (ByteBuffer buf : buffers) {
                  len += buf.remaining();
              }
              int contentLength = len - 6;
              ByteBuffer firstbuf = buffers[0];
              if (contentLength <= 0x7D) { //125
                  firstbuf.put(4, opcode);
                  firstbuf.put(5, (byte) contentLength);
                  firstbuf.position(4);
              } else if (contentLength <= 0xFFFF) {
                  firstbuf.put(2, opcode);
                  firstbuf.put(3, (byte) 0x7E); //126
                  firstbuf.putChar(4, (char) contentLength);
                  firstbuf.position(2);
              } else {
                  firstbuf.put(0, opcode);
                  firstbuf.put(1, (byte) 0x7F); //127
                  firstbuf.putInt(2, contentLength);
              }
              return buffers;
          }
  
          ByteBuffer buffer = supplier.get();  //确保ByteBuffer的capacity不能小于128
          byte[] content = content();
          if (cryptor != null) {
              ByteBuffer[] ss = new ByteBuffer[]{ByteBuffer.wrap(content)};
              ByteBuffer[] bs = cryptor.encrypt(ss, supplier, consumer);
              if (bs != ss) {
                  int r = 0;
                  for (ByteBuffer bb : bs) {
                      r += bb.remaining();
                  }
                  content = new byte[r];
                  int index = 0;
                  for (ByteBuffer bb : bs) {
                      int re = bb.remaining();
                      bb.get(content, index, re);
                      index += re;
                  }
                  for (ByteBuffer bb : bs) {
                      consumer.accept(bb);
                  }
              }
          }
          final int len = content.length;
          if (len <= 0x7D) { //125
              buffer.put(opcode);
              buffer.put((byte) len);
              buffer.put(content);
              buffer.flip();
              return new ByteBuffer[]{buffer};
          }
          if (len <= 0xFFFF) { // 65535
              buffer.put(opcode);
              buffer.put((byte) 0x7E); //126
              buffer.putChar((char) len);
          } else {
              buffer.put(opcode);
              buffer.put((byte) 0x7F); //127
              buffer.putInt(len);
          }
          int start = buffer.remaining();
          int pend = len - buffer.remaining();
          if (pend <= 0) {
              buffer.put(content);
              buffer.flip();
              return new ByteBuffer[]{buffer};
          }
          buffer.put(content, 0, buffer.remaining());
          buffer.flip();
          final int capacity = buffer.capacity();
          final ByteBuffer[] buffers = new ByteBuffer[(pend / capacity) + 1 + ((pend % capacity) > 0 ? 1 : 0)];
          buffers[0] = buffer;
          for (int i = 1; i < buffers.length; i++) {
              ByteBuffer buf = supplier.get();
              buf.put(content, start, Math.min(pend, capacity));
              buf.flip();
              buffers[i] = buf;
              start += capacity;
              pend -= capacity;
          }
          return buffers;
      }