@Override
        public <T extends Message<T>> byte[] serialize(T message)
        {
            try
            {
                ByteArrayOutputStream out = new ByteArrayOutputStream();
                JsonXIOUtil.writeTo(out, message, true, buffer);
                return out.toByteArray();
            }
            catch (IOException e)
            {
                throw new RuntimeException(e);
            }
            finally
            {
                buffer.clear();
            }
        }
Compare the outputs of different json impls.

@author David Yu
@created Jul 2, 2010
protostuff-json/src/test/java/io/protostuff/JsonCompareOutputsTest.java