@Test
    public void testOverFlow() throws java.io.IOException {
        stream.reset();
        byte[] b = new byte[] { 97, 98, 99 };
        ByteWriter bw = new ByteWriter(stream, encoder);
        int i = 0;
        while (i < 5000) {
            bw.append(b);
            ++i;
        }
        bw.close();
        byte[] res = stream.toByteArray();
        assertEquals(15000, res.length);
        i = 0;
        int base = 0;
        while (i < 5000) {
            byte[] sub = new byte[3];
            System.arraycopy(res, base, sub, 0, 3);
            assertTrue(Arrays.equals(new byte[] { 97, 98, 99 }, sub));
            base += 3;
            ++i;
        }
    }
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