Module de.carne.mcd

Class InstructionIndex

    • Method Detail

      • lookupNextInstruction

        public @Nullable InstructionIndex.LookupResult lookupNextInstruction​(MCDInputBuffer buffer,
                                                                             boolean eager)
                                                                      throws java.io.IOException
        Looks up the next Instruction instance corresponding to the opcode bytes provided via the given MCDInputBuffer instance.
        Parameters:
        buffer - the MCDInputBuffer to read the opcode bytes from.
        eager - whether to match the maximum length opcode or not.
        Returns:
        the resolved Instruction instance (or null if EOF is reached).
        Throws:
        java.io.IOException - if an I/O error occurs.
      • positionBytes

        public int positionBytes()
        Description copied from interface: InstructionIndexParameters
        Gets the number of bytes used to encode a file position in the index's lookup table.
        Specified by:
        positionBytes in interface InstructionIndexParameters
        Returns:
        the number of bytes used to encode a file position in the index's lookup table.
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException