Slow Class file dump
Carl Cronje <[email protected]>
| Newsgroups | gmane.comp.jakarta.bcel.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi
I have noticed that dumping a JavaClass to disk is very slow
Could someone with update permission please fix:
JavaClass.java
in method -- public void dump(File file) (line number 268)
to use a BufferedOutputStream i.e.:
dump(new DataOutputStream(new BufferedOutputStream(new
FileOutputStream(file))));
the perf is about 95% faster.
Thanks
Carl
/**
* Dump class to a file.
*
* @param file Output file
* @throws IOException
*/
public void dump(File file) throws IOException
{
String parent = file.getParent();
if(parent != null) {
File dir = new File(parent);
if(dir != null)
dir.mkdirs();
}
dump(new DataOutputStream(new FileOutputStream(file)));
}