FileDocCategorySizeDatePackage
OutputStreamWrapper.javaAPI DocGlassfish v2 API4872Fri May 04 22:34:26 BST 2007com.sun.jdo.api.persistence.enhancer

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.

Fields Summary
private OutputStream
out
The wrapped output stream.
private String
className
The classname of the written Java class. This parameter is set by the enhancer.
Constructors Summary
public OutputStreamWrapper(OutputStream out)
Constructs a new object.

param
out The output stream to wrap.



                        

       
    

        this.out = out;

    
Methods Summary
public final java.lang.StringgetClassName()
Gets the classname of the written Java class. This method should be called after the class has been enhanced.

return
The name of the written Java class.
see
#className


        return this.className;

    
public final java.io.OutputStreamgetStream()
Gets the wrapped output stream.

return
The wrapped output stream.
see
#out


        return this.out;

    
public final voidsetClassName(java.lang.String classname)
Sets the name of the written Java class. This method should be called by the enhancer.

param
classname The name of the Java class.
see
#className


        this.className = classname;