Class CodePrinter


  • public class CodePrinter
    extends Object
    Bytecode disassembler for converting raw bytecode into human-readable format.
    • Constructor Detail

      • CodePrinter

        public CodePrinter()
    • Method Detail

      • prettyPrintCode

        public static String prettyPrintCode​(byte[] code,
                                             ConstPool constPool)
        Disassembles raw bytecode into the terse per-instruction listing.
        Parameters:
        code - the method's bytecode
        constPool - the constant pool for resolving references
        Returns:
        a string representing the disassembled bytecode
      • prettyPrintCode

        public static String prettyPrintCode​(CodeAttribute codeAttribute,
                                             DisassemblyOptions options)
        Disassembles a method's CodeAttribute with the enrichments selected by options.
        Parameters:
        codeAttribute - the method's Code attribute
        options - the enrichments to include
        Returns:
        the disassembled method