code: public static ByteBuf copiedBuffer(char[] array, Charset charset) {
          if (array == null) {
              throw new NullPointerException("array");
          }
          return copiedBuffer(array, 0, array.length, charset);
      }
docs: Creates a new big-endian buffer whose content is the specified
  {@code array} encoded in the specified {@code charset}.
  The new buffer's {@code readerIndex} and {@code writerIndex} are
  {@code 0} and the length of the encoded string respectively.