HttpCharset extends Token { static HttpCharset parse(byte[] bytes, int pos, int length) { return charsets.getOrCreate(bytes, pos, 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 testParser() { HttpCharset expected = HttpCharset.US_ASCII; byte[] asciis = "us-ascii".getBytes(forName("ASCII")); HttpCharset actual = HttpCharset.parse(asciis, 0, asciis.length); assertSame(expected, actual); }