code: public static ByteBuf encodeStringAsUtf8(String source) {
          ByteBuf target = Unpooled.buffer(source.length());
          ByteBufUtil.writeUtf8(target, source);
          return target;
      }
docs: Helper method to encode a String into UTF8 via fast-path methods.
  
  @param source the source document.
  @return the encoded byte buffer.