public void add(String entry,byte[] bytes,boolean overwrite) throws IOException {
  JarEntry newEntry=new JarEntry(entry);
  if (jarEntries.containsKey(entry) && !overwrite) {
    throw new IOException("Archive already contains entry: " + entry);
  }
 else {
    jarEntries.remove(entry);
    jarEntriesToAdd.remove(entry);
    jarEntries.put(entry,newEntry);
    jarEntriesToAdd.put(entry,bytes);
  }
}

public void add ( String entry , byte [ ] bytes , boolean overwrite ) throws IOException { JarEntry newEntry = new JarEntry ( entry ) ; if ( jarEntries . containsKey ( entry ) && ! overwrite ) { throw new IOException ( "Archive already contains entry: " + entry ) ; } else { jarEntries . remove ( entry ) ; jarEntriesToAdd . remove ( entry ) ; jarEntries . put ( entry , newEntry ) ; jarEntriesToAdd . put ( entry , bytes ) ; } }
adds ( or optionally overwrites ) an archive entry
