@Test
    public void testWriteInt() throws java.io.IOException {
        stream.reset();
        ByteWriter b = new ByteWriter(stream, encoder);
        b.write((int) 'z');
        b.close();
        assertArrayEquals(Utf8.toBytes("z"), stream.toByteArray());
    }
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