public void testFoo() throws Exception
    {
        Foo fooCompare = foo;
        Foo dfoo = new Foo();

        byte[] output = toByteArray(fooCompare);
        mergeFrom(output, 0, output.length, dfoo, dfoo.cachedSchema());
        SerializableObjects.assertEquals(fooCompare, dfoo);
    }
Deserializes from the byte array and data is merged/saved to the message.
protostuff-core/src/test/java/io/protostuff/StandardTest.java