Turn the given UTF8 byte array into a string @param bytes The byte array @return The string
(byte[] bytes)
| 35 | * @return The string |
| 36 | */ |
| 37 | public static String utf8(byte[] bytes) { |
| 38 | try { |
| 39 | return new String(bytes, "UTF8"); |
| 40 | } catch (UnsupportedEncodingException e) { |
| 41 | throw new RuntimeException("This shouldn't happen.", e); |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * Turn a string into a utf8 byte[] |