Package org.codehaus.groovy.classgen.asm

# Class BytecodeDumper

java.lang.Object
org.codehaus.groovy.classgen.asm.BytecodeDumper

All Implemented Interfaces:
  `BytecodeProcessor`

public class BytecodeDumper extends Object implements BytecodeProcessor
A utility class which can be used in test cases to dump generated bytecode.

Since:
  2.4.0

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final BytecodeDumper`
  `STANDARD_ERR`
  Dumps generated bytecode to `System.err`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BytecodeDumper(Writer out)`
  Creates a bytecode dumper that writes to the supplied stream.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `byte[]`
  `processBytecode(String name, byte[] original)`
  Transforms the bytecode for a generated class.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### STANDARD_ERR

    public static final BytecodeDumper STANDARD_ERR
    Dumps generated bytecode to `System.err`.

- ## Constructor Details

  - ### BytecodeDumper

    public BytecodeDumper(Writer out)
    Creates a bytecode dumper that writes to the supplied stream.
    Parameters:
      `out` - the destination writer

- ## Method Details

  - ### processBytecode

    public byte[] processBytecode(String name, byte[] original)
    Transforms the bytecode for a generated class.
    Specified by:
      `processBytecode` in interface `BytecodeProcessor`
    Parameters:
      `name` - the class name
      `original` - the original class bytes
    Returns:
      the processed class bytes