// Write out the length of the file
final FileStatus file = fs.getFileStatus(jar);
out.writeLong(file.getLen());
// Now write the jar file
final FSDataInputStream inStream = fs.open(this.userJars.get(i));
final byte[] buf = new byte[BUFFERSIZE];
int read = inStream.read(buf, 0, buf.length);
while (read > 0) {
out.write(buf, 0, read);
read = inStream.read(buf, 0, buf.length);
}
}
}