Menu

#2 patch 001 - fixed slowness of jar embedder

v1.0_(example)
open
nobody
None
5
2010-09-29
2010-09-29
No

//package de.wcondev.launch4l;
//Builder.java

// TODO Use buffer to copy jar more efficient.
if (project.isEmbedded()) {
try {
log("Embedding jar " + project.getJar() + "...");
byte[] buf=new byte[64*1024];
final InputStream is = new FileInputStream(project.getJar());
final OutputStream os = new FileOutputStream(project.getOutfile(), true);
while (true) {
int rd=is.read(buf);
if(rd<0)break;
if(rd==0)throw new AssertionError();
os.write(buf,0,rd);
}
os.close();
is.close();
} catch (IOException e) {
throw new BuilderException("Error while embedding jar file: " + e.getMessage(), e);
}
}

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.