private int captureHeader(final List<Token> tokens)
    {
        final List<Token> headerTokens = new ArrayList<>();

        int index = 0;
        Token token = tokens.get(index);
        final String headerName = token.name();
        headerTokens.add(token);
        do
        {
            token = tokens.get(++index);
            headerTokens.add(token);
        }
        while (Signal.END_COMPOSITE != token.signal() || !headerName.equals(token.name()));

        irHeader = headerTokens;

        return index;
    }
Decode the serialised {@link Ir} and return the decoded instance.

@return the decoded serialised {@link Ir} instance.
sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/IrDecoder.java