public static ByteBuffer fromUtf8String(CharSequence utfString) {
        if (utfString == null || utfString.length() == 0) {
            return Buffers.EMPTY_BYTE_BUFFER;
        } else {
            return ByteBuffer.wrap(utfString.toString().getBytes(StandardCharsets.UTF_8));
        }
    }
public static ByteBuffer fromUtf8String ( CharSequence utfString ) { if ( utfString == null || utfString . length ( ) == 0 ) { return Buffers . EMPTY_BYTE_BUFFER ; } else { return ByteBuffer . wrap ( utfString . toString ( ) . getBytes ( StandardCharsets . UTF_8 ) ) ; } }
Create a {@link ByteBuffer} which holds the UTF8 encoded bytes for the
given {@link String}.

@param utfString The {@link String} to convert
@return buffer   The {@link ByteBuffer} which was created