// copy the files from the old JAR to the new, but don't close the new JAR yet
while ((inEnt = in.getNextEntry()) != null) {
ZipEntry outEnt = new ZipEntry(inEnt); // copy size, modification time etc.
byte[] data = new byte[(int)inEnt.getSize()];
in.read(data); // read data for this old entry
in.closeEntry();
try{
out.putNextEntry(outEnt);
out.write(data); // copy it to the new entry
out.closeEntry();
}