Class OutputStreamWrapper


  • public class OutputStreamWrapper
    extends Object
    This class serves as a wrapper for an output stream of a class file. The stream is passed as a parameter to the byte code enhancer, that can sets the classname of the written Java class to the wrapper.
    This wrapper is necessary to determine the classname outside the enhancer, after the class has been enhanced, since do do not always know the classname of an opened input stream.

    • Constructor Detail

      • OutputStreamWrapper

        public OutputStreamWrapper​(OutputStream out)
        Constructs a new object.
        Parameters:
        out - The output stream to wrap.
    • Method Detail

      • getStream

        public final OutputStream getStream()
        Gets the wrapped output stream.
        Returns:
        The wrapped output stream.
        See Also:
        out
      • getClassName

        public final String getClassName()
        Gets the classname of the written Java class. This method should be called after the class has been enhanced.
        Returns:
        The name of the written Java class.
        See Also:
        className
      • setClassName

        public final void setClassName​(String classname)
        Sets the name of the written Java class. This method should be called by the enhancer.
        Parameters:
        classname - The name of the Java class.
        See Also:
        className