@Test
    public void testGetEncoding() throws java.io.IOException {
        stream.reset();
        ByteWriter b = new ByteWriter(stream, encoder);
        assertEquals(Utf8.getCharset(), b.getEncoding());
        b.close();
    }
A stream which does nothing, but complains if it is called and asked to
do nothing.
vespajlib/src/test/java/com/yahoo/io/ByteWriterTestCase.java