@Test
public void readText() throws IOException {

    test(new CB() {
        public void run(boolean close) throws IOException {
            SR sr = new SR(chars);
            assertEquals(chars, StreamUtil.readText(sr, close));
            sr.assertClosed(close);
            BAIS bais = new BAIS(bytes);
            assertEquals(chars, StreamUtil.readText(bais, "GBK", close));
            bais.assertClosed(close);
        }
    });
}