docs: final private ByteBuffer stringToByteBuffer(CharSequence s) {
          bb.clear();
          final int len = s.length();
          for (int i = 0; i < len; i++) {
              if (bb.remaining() < 3) {
                  ByteBuffer n = ByteBuffer.allocate(bb.capacity() << 1);
                  bb.flip();
                  n.put(bb);
                  bb = n;
              }
              char c = s.charAt(i);
              if (c < 0x80) {
                  bb.put((byte) c);
              } else if (c < 0x800) {
                  bb.put((byte) (0xc0 | (c >> 6)));
                  bb.put((byte) (0x80 | (c & 0x3f)));
              } else {
                  bb.put((byte) (0xe0 | (c >> 12)));
                  bb.put((byte) (0x80 | ((c >> 6) & 0x3f)));
                  bb.put((byte) (0x80 | (c & 0x3f)));
              }
          }
          bb.flip();
          return bb;
      }