@Test public void getCharsetForId() throws Exception { assertThat(encoding.getCharsetForId(TextEncoding.ISO_8859_1), is(StandardCharsets.ISO_8859_1)); assertThat(encoding.getCharsetForId(TextEncoding.UTF_16), is(StandardCharsets.UTF_16)); assertThat(encoding.getCharsetForId(TextEncoding.UTF_16BE), is(StandardCharsets.UTF_16BE)); assertThat(encoding.getCharsetForId(TextEncoding.UTF_8), is(StandardCharsets.UTF_8)); }
public Charset getCharsetForId(final int id) throws NoSuchElementException { if (!containsKey(id)) { throw new NoSuchElementException("id=" + Integer.toString(id)); } return values[id]; }
TextEncoding implements SimpleIntStringMap { public Charset getCharsetForId(final int id) throws NoSuchElementException { if (!containsKey(id)) { throw new NoSuchElementException("id=" + Integer.toString(id)); } return values[id]; } }
TextEncoding implements SimpleIntStringMap { public Charset getCharsetForId(final int id) throws NoSuchElementException { if (!containsKey(id)) { throw new NoSuchElementException("id=" + Integer.toString(id)); } return values[id]; } private  TextEncoding(); }
TextEncoding implements SimpleIntStringMap { public Charset getCharsetForId(final int id) throws NoSuchElementException { if (!containsKey(id)) { throw new NoSuchElementException("id=" + Integer.toString(id)); } return values[id]; } private  TextEncoding(); static TextEncoding getInstanceOf(); byte getIdForCharset(final Charset charset); Charset getCharsetForId(final int id); @Override boolean containsKey(final int key); @Override String getValue(final int key); }
TextEncoding implements SimpleIntStringMap { public Charset getCharsetForId(final int id) throws NoSuchElementException { if (!containsKey(id)) { throw new NoSuchElementException("id=" + Integer.toString(id)); } return values[id]; } private  TextEncoding(); static TextEncoding getInstanceOf(); byte getIdForCharset(final Charset charset); Charset getCharsetForId(final int id); @Override boolean containsKey(final int key); @Override String getValue(final int key); static final byte MAX_TEXT_ENCODING_ID; static final byte ISO_8859_1; static final byte UTF_16; static final byte UTF_16BE; static final byte UTF_8; static final int TEXT_ENCODING_FIELD_SIZE; }