protected DataOutputStream makeFileOutput(String directoryName) { String classname = getName(); String filename = directoryName + File.separatorChar + classname.replace('.', File.separatorChar) + ".class"; int pos = filename.lastIndexOf(File.separatorChar); if (pos > 0) { String dir = filename.substring(0, pos); if (!dir.equals(".")) new File(dir).mkdirs(); } return new DataOutputStream(new BufferedOutputStream( new DelayedFileOutputStream(filename))); }
@Override public void write(byte[] b, int off, int len) throws IOException { init(); file.write(b, off, len); }
new DelayedFileOutputStream(filename))); try { toBytecode(out);
/** * Writes a class file represented by this <code>CtClass</code> * object on a local disk. * Once this method is called, further modifications are not * possible any more. * * @param directoryName it must end without a directory separator. */ public void writeFile(String directoryName) throws CannotCompileException, IOException { String classname = getName(); String filename = directoryName + File.separatorChar + classname.replace('.', File.separatorChar) + ".class"; int pos = filename.lastIndexOf(File.separatorChar); if (pos > 0) { String dir = filename.substring(0, pos); if (!dir.equals(".")) new File(dir).mkdirs(); } DataOutputStream out = new DataOutputStream(new BufferedOutputStream( new DelayedFileOutputStream(filename))); try { toBytecode(out); } finally { out.close(); } }
public void write(byte[] b, int off, int len) throws IOException { init(); file.write(b, off, len); }
public void write(byte[] b, int off, int len) throws IOException { init(); file.write(b, off, len); }
public void write(byte[] b, int off, int len) throws IOException { init(); file.write(b, off, len); }
public void write(int b) throws IOException { init(); file.write(b); }
public void flush() throws IOException { init(); file.flush(); }
public void write(int b) throws IOException { init(); file.write(b); }
public void flush() throws IOException { init(); file.flush(); }
public void flush() throws IOException { init(); file.flush(); }
public void write(byte[] b, int off, int len) throws IOException { init(); file.write(b, off, len); }
public void write(byte[] b) throws IOException { init(); file.write(b); }
public void write(int b) throws IOException { init(); file.write(b); }
public void write(byte[] b) throws IOException { init(); file.write(b); }
public void write(byte[] b) throws IOException { init(); file.write(b); }
public void write(int b) throws IOException { init(); file.write(b); }
public void flush() throws IOException { init(); file.flush(); }
public void write(byte[] b) throws IOException { init(); file.write(b); }