public void testNestedLarge()
    {
        final int bufSize = 256;
        final Bar bar = new Bar();

        // nested message size will be:
        // 1 + 1 = tag + value (10)
        // 1 + 1 + 125 = tag + delim + value ("baz")
        // 1 + 1 = tag + value (15)
        // =====
        // 131
        bar.setSomeBaz(new Baz(10, repeatChar('b', 125), 15l));

        // size will be:
        // 1 (tag)
        // 2 (delimited length) (nested message size is greater than 127)
        // 131 (nested message size)
        // =====
        // 134
        byte[] data = ProtobufIOUtil.toByteArray(bar, bar.cachedSchema(), buf(bufSize));
        assertEquals(134, data.length);

        final Bar parsedBar = new Bar();
        ProtobufIOUtil.mergeFrom(data, parsedBar, parsedBar.cachedSchema());
        assertEquals(bar, parsedBar);
    }
Test the buffering output capability of {@link ProtobufOutput}.

@author David Yu
@created Oct 7, 2010
protostuff-core/src/test/java/io/protostuff/ProtobufBufferedOutputTest.java