public static byte [ ] getBytesUTF8 ( String string ) { if ( string == null ) { return null ; } try { return string . getBytes ( "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { // This never happens. return null ; } }
Get a UTF - 8 byte array representation of the given string .