code: public void writeEntries(JarFile jarFile) throws IOException {
          Enumeration<JarEntry> entries = jarFile.entries();
          while (entries.hasMoreElements()) {
              JarEntry entry = entries.nextElement();
              ZipHeaderPeekInputStream inputStream = new ZipHeaderPeekInputStream(
                      jarFile.getInputStream(entry));
              try {
                  if (inputStream.hasZipHeader() && entry.getMethod() != ZipEntry.STORED) {
                      new CrcAndSize(inputStream).setupStoredEntry(entry);
                      inputStream.close();
                      inputStream = new ZipHeaderPeekInputStream(
                              jarFile.getInputStream(entry));
                  }
                  EntryWriter entryWriter = new InputStreamEntryWriter(inputStream, true);
                  writeEntry(entry, entryWriter);
              } finally {
                  inputStream.close();
              }
          }
      }
docs: Write all entries from the specified jar file.
  
  @param jarFile the source jar file
  @throws IOException if the entries cannot be written