code: public static ByteBuf encodeString(ByteBufAllocator alloc, CharBuffer src, Charset charset, int extraCapacity) {
          return encodeString0(alloc, false, src, charset, extraCapacity);
      }
docs: Encode the given {@link CharBuffer} using the given {@link Charset} into a new {@link ByteBuf} which
  is allocated via the {@link ByteBufAllocator}.
  
  @param alloc The {@link ByteBufAllocator} to allocate {@link ByteBuf}.
  @param src The {@link CharBuffer} to encode.
  @param charset The specified {@link Charset}.
  @param extraCapacity the extra capacity to alloc except the space for decoding.