code: public static byte[] strToUtf8(final String str) {
      final ByteBuffer buffer = CHARSET_UTF8.encode(str);
      final byte[] bytesArray = new byte[buffer.remaining()];
      buffer.get(bytesArray, 0, bytesArray.length);
      return bytesArray;
    }
docs: Convert a string into its UTF8 representation.
  
  @param str string to be converted, must not be null
  @return array of chars from the string in utf8 format, must not be null
  @since 1.4.0