- /**
- * Return the bytes array representation of the given {@link String} in
- * UTF-8.
- *
- * @param str
- * the {@link String} to transform into bytes
- * @return the content in bytes
- */
- static public byte[] bytes(String str) {
- try {
- return str.getBytes("UTF-8");
- } catch (UnsupportedEncodingException e) {
- // All conforming JVM must support UTF-8
- e.printStackTrace();
- return null;
- }
- }
-