public void print(final StringBuilder output, final DirectBuffer buffer, final int offset)
    {
        final int blockLength = headerDecoder.getBlockLength(buffer, offset);
        final int templateId = headerDecoder.getTemplateId(buffer, offset);
        final int schemaId = headerDecoder.getSchemaId(buffer, offset);
        final int actingVersion = headerDecoder.getSchemaVersion(buffer, offset);

        validateId(schemaId);

        final int messageOffset = offset + headerDecoder.encodedLength();
        final List<Token> msgTokens = ir.getMessage(templateId);

        OtfMessageDecoder.decode(
            buffer,
            messageOffset,
            actingVersion,
            blockLength,
            msgTokens,
            new JsonTokenListener(output));
    }
Print the encoded message to the output.

@param output to write too.
@param buffer with encoded message and header.
@param offset at which the header begins.
sbe-tool/src/main/java/uk/co/real_logic/sbe/json/JsonPrinter.java