public static byte[] fromString(String unicodeString) {

        byte[] result = null;
        if (unicodeString != null) {
            result = unicodeString.getBytes(StandardCharsets.UTF_8);
        }
        return result;
    }
public static byte [ ] fromString ( String unicodeString ) { byte [ ] result = null ; if ( unicodeString != null ) { result = unicodeString . getBytes ( StandardCharsets . UTF_8 ) ; } return result ; }
Converts the given String to a byte array.

@param unicodeString The String to be converted to a byte array.
@return A byte array representing the String.