@Test
    public void testLongString() throws IOException {
        final int length = BufferChain.BUFFERSIZE * BufferChain.MAXBUFFERS * 3;
        StringBuilder b = new StringBuilder(length);
        String s;
        for (int i = length; i > 0; --i) {
            b.append("\u00E5");
        }
        s = b.toString();
        stream.reset();
        ByteWriter bw = new ByteWriter(stream, encoder);
        bw.write(s);
        bw.close();
        String res = stream.toString("UTF-8");
        assertEquals(s, res);
    }
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