code: public static void addFileToZipOutputStream(File file, ZipOutputStream zipOs) throws IOException {
          String fileName = file.getName();
          try (FileInputStream fos = new FileInputStream(file)) {
              ZipEntry zipEntry = new ZipEntry(fileName);
              zipEntry.setSize(file.length());
              zipEntry.setTime(System.currentTimeMillis());
              zipOs.putNextEntry(zipEntry);
              byte[] buf = new byte[1024];
              int bytesRead;
              while ((bytesRead = fos.read(buf)) > 0) {
                  zipOs.write(buf, 0, bytesRead);
              }
              zipOs.closeEntry();
              fos.close();
          }
      }
docs: Adds the specified file to the zip output stream.
  
  @param file
  @param zipOs