public Ir decode()
    {
        decodeFrame();

        final List<Token> tokens = new ArrayList<>();
        while (offset < length)
        {
            tokens.add(decodeToken());
        }

        int i = 0;
        if (tokens.get(0).signal() == Signal.BEGIN_COMPOSITE)
        {
            i = captureHeader(tokens);
        }

        ByteOrder byteOrder = null;
        for (int j = 0; j < tokens.size(); j++)
        {
            if (tokens.get(j).signal() == Signal.ENCODING)
            {
                byteOrder = tokens.get(j).encoding().byteOrder();
                break;
            }
        }

        final Ir ir = new Ir(
            irPackageName, irNamespaceName, irId, irVersion, null, semanticVersion, byteOrder, irHeader);

        for (int size = tokens.size(); i < size; i++)
        {
            if (tokens.get(i).signal() == Signal.BEGIN_MESSAGE)
            {
                i = captureMessage(tokens, i, ir);
            }
        }

        return ir;
    }
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