static void verifyProtobuf(PojoWithInts p) throws IOException
    {
        Schema<PojoWithInts> schema = PojoWithInts.getSchema();
        byte[] data = ProtobufIOUtil.toByteArray(p, schema, buf());

        PojoWithInts pFromByteArray = new PojoWithInts();
        ProtobufIOUtil.mergeFrom(data, pFromByteArray, schema);

        assertEquals(p, pFromByteArray);

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ProtobufIOUtil.writeTo(out, p, schema, buf());

        byte[] dataFromStream = out.toByteArray();
        assertTrue(Arrays.equals(data, dataFromStream));

        ByteArrayInputStream in = new ByteArrayInputStream(data);
        PojoWithInts pFromStream = new PojoWithInts();
        ProtobufIOUtil.mergeFrom(in, pFromStream, schema);

        assertEquals(p, pFromStream);
    }
Tests for various protobuf int flavors.

@author David Yu
@created Feb 14, 2011
protostuff-core/src/test/java/io/protostuff/IntTest.java