library/src/main/java/com/kdgregory/aws/utils/CommonUtils.java
/**
     *  Converts a string to its UTF-8 representation. Replaces the checked exception
     *  with a runtime exception that should never happen unless the JVM installation
     *  is completely borked.
     */
Converts a string to its UTF-8 representation. Replaces the checked exception
with a runtime exception that should never happen unless the JVM installation
is completely borked.
Converts a string to its UTF - 8 representation . Replaces the checked exception with a runtime exception that should never happen unless the JVM installation is completely borked .
public static byte[] toUTF8(String str)
    {
        try
        {
            return str.getBytes("UTF-8");
        }
        catch (UnsupportedEncodingException ex)
        {
            throw new RuntimeException("JVM does not support UTF-8", ex);
        }
    }
public static byte [ ] toUTF8 ( String str ) { try { return str . getBytes ( "UTF-8" ) ; } catch ( UnsupportedEncodingException ex ) { throw new RuntimeException ( "JVM does not support UTF-8" , ex ) ; } }
Converts a string to its UTF-8 representation.
Converts a string to its UTF - 8 representation .