code: public static void packDirectory(File dir, ZipOutputStream zos) throws IOException {
          byte[] buffer = new byte[64 * 1024];  // a reusable buffer
          try {
              traverseAndWrite(dir, zos, new StringBuilder(), true, buffer);
          } finally {
              close(zos);
          }
      }
docs: Pack a directory into a single zip file.
  <p>
  <b>Note:</b> The implementation is based on the packZip method in jetbrains openAPI.
  original author is Maxim Podkolzine (maxim.podkolzine@jetbrains.com)
  </p>
  
  @param dir input
  @param zos output stream
  @throws IOException exception1