HttpCharset extends Token { static int render(HttpCharset charset, byte[] container, int pos) { System.arraycopy(charset.bytes, charset.offset, container, pos, charset.length); return charset.length; } private  HttpCharset(byte[] bytes, int offset, int length, @Nullable byte[] lowerCaseBytes, int lowerCaseHashCode); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final HttpCharset UTF_8; static final HttpCharset US_ASCII; static final HttpCharset LATIN_1; }
@Test public void testCharsetRender() { String expected = "utf-8"; HttpCharset charset = HttpCharset.UTF_8; byte[] container = new byte[5]; int pos = HttpCharset.render(charset, container, 0); assertEquals(5, pos); assertEquals(expected, new String(container)); }