public void testBarSkipMessage() throws Exception
    {
        final CustomSchema<Bar> barSchema = new CustomSchema<Bar>(bar.cachedSchema())
        {
            @Override
            public void writeTo(Output output, Bar message) throws IOException
            {
                // 10 is an unknown field
                output.writeObject(10, baz, Baz.getSchema(), false);
                super.writeTo(output, message);
            }
        };

        for (Bar barCompare : new Bar[] { bar, negativeBar })
        {
            Bar dbar = new Bar();

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