private static byte[] getBytes(String str) {
        final char[] chars = str.toCharArray();
        final int size = chars.length;
        final byte[] bytes = new byte[size];

        for (int i = 0; i < size;) {
            bytes[i] = (byte) chars[i++];
        }
        return bytes;
    }
Gets the bytes representation of a string.
@param str string to convert
@return byte[]
core/src/main/java/com/linecorp/armeria/common/multipart/MimeParser.java