public byte[] toByteArray()
    {
        int start = 0;
        byte[] buffer = new byte[size];
        for (ByteArrayNode node = root.next; node != null; node = node.next)
        {
            byte[] bytes = node.bytes;
            System.arraycopy(bytes, 0, buffer, start, bytes.length);
            start += bytes.length;
        }
        return buffer;
    }
Returns the data written to this output as a single byte array.
protostuff-core/src/test/java/io/protostuff/DeferredOutput.java