Utility method to silently get UTF-8 bytes from a string, which should always work.
(String source)
| 564 | * always work. |
| 565 | */ |
| 566 | static byte[] toBytes(String source) { |
| 567 | try { |
| 568 | return source.getBytes("UTF8"); |
| 569 | } catch (UnsupportedEncodingException e) { |
| 570 | throw new IllegalArgumentException(e.getMessage()); |
| 571 | } |
| 572 | } |
| 573 | /** |
| 574 | * Utility method to find the first invalid character as per RFC 2396 |
| 575 | * section 2. This helps us prevent creating excessive objects in the |
no test coverage detected