public void testFooEmpty() throws Exception
    {
        Schema<Foo> schema = Foo.getSchema();
        Foo message = new Foo();

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        int size = optWriteDelimitedTo(out, message, schema, buf());
        int delimSize = ProtobufOutput.computeRawVarint32Size(size);
        byte[] data = out.toByteArray();

        int expectedSize = size + delimSize;
        assertEquals(expectedSize, data.length);
        verifyOptData(data, message, schema, buf());

        // empty
        assertEquals(size, 0);
        assertEquals(delimSize, 1);

        ByteArrayInputStream in = new ByteArrayInputStream(data);

        Foo parsedMessage = schema.newMessage();
        boolean merged = optMergeDelimitedFrom(in, parsedMessage, schema, buf());
        assertTrue(merged);

        assertEquals(message, parsedMessage);
    }
Deserializes from the byte array and data is merged/saved to the message.
protostuff-core/src/test/java/io/protostuff/DelimiterTest.java