@Override
    protected <T> byte[] toByteArray(T message, Schema<T> schema)
    {
        final LinkedBuffer buffer = localBuffer.get();
        try
        {
            return JsonXIOUtil.toByteArray(message, schema, false, buffer);
        }
        finally
        {
            buffer.clear();
        }
    }
Test for re-using a thread-local buffer across many serializations.

@author David Yu
@created Jan 15, 2011
protostuff-json/src/test/java/io/protostuff/JsonBufferReuseTest.java