JBoss Community

Re: ClassFile write(java.io.DataOutputStream out) generates empty file!!

created by Carlos Bruguera in Javassist - View the full discussion

Oh, I forgot..

 

writeFile(initClass) will just do this:

 

public static void writeFile(ClassFile cf){
     try{
          cf.setVersionToJava5();
          cf.write(new DataOutputStream(new BufferedOutputStream(new FileOutputStream(cf.getName() + ".class"))));
     }catch(IOException e){
          Errors.add("Error al escribir el archivo " + name);
     }
}

 

I really need help :(

Reply to this message by going to Community

Start a new discussion in Javassist at Community