public static byte[] toBytesDirect(final String singleOctets) {
        final char[] src = singleOctets.toCharArray();
        final byte[] dest = new byte[src.length];
        
        for (int i=0; i < dest.length; i++) {
            final char c = src[i];
            
            if (c > Byte.MAX_VALUE)
                throw new IllegalArgumentException("Invalid character found at position " + i + " for " + singleOctets);
            dest[i] = (byte)c;
        }
        return dest;
    }
Returns a byte array representing the given string,
truncating each character into a byte directly.

@throws IllegalArgumentException if the input string contains any multi-octet character
aws-java-sdk-core/src/main/java/com/amazonaws/util/CodecUtils.java