()
| 469 | } |
| 470 | |
| 471 | public void testGetBytesWithCharset() throws Exception { |
| 472 | final Charset CHARSET_UTF8 = Charset.forName("UTF-8"); |
| 473 | byte[] buf = Native.getBytes(getName() + UNICODE, CHARSET_UTF8); |
| 474 | assertEquals("Incorrect native bytes from Java String", getName() + UNICODE, new String(buf, CHARSET_UTF8)); |
| 475 | } |
| 476 | |
| 477 | public void testGetBytesBadEncoding() throws Exception { |
| 478 | byte[] buf = Native.getBytes(getName(), "unsupported"); |