convert a java string to byte[] with 8bit latin 1 avoid String.getBytes() because it is using system specific character encoding.
(String value)
| 301 | * avoid String.getBytes() because it is using system specific character encoding. |
| 302 | */ |
| 303 | public static byte[] stringToBytes(String value) { |
| 304 | try { |
| 305 | return value.getBytes("ISO-8859-1"); |
| 306 | } catch (UnsupportedEncodingException e) { |
| 307 | // can't happen: Latin 1 is a standard encoding |
| 308 | return null; |
| 309 | } |
| 310 | } |
| 311 | |
| 312 | /** |
| 313 | * convert a byte[] with 8bit latin 1 to java string |
no outgoing calls
no test coverage detected