code: private synchronized static void unzip(InputStream zipFileInputStream, String destinationDir) throws IOException {
          // Create output directory if it doesn't exist
          File dir = new File(destinationDir);
          if (!dir.exists()) dir.mkdirs();
  
          // Buffer for read and write data to file
          byte[] buffer = new byte[1024];
          ZipInputStream zis = new ZipInputStream(zipFileInputStream);
          ZipEntry ze = zis.getNextEntry();
          while (ze != null) {
              String fileName = ze.getName();
              File newFile = new File(destinationDir + File.separator + fileName);
  
              // Check if it's a Directory entry
              if (ze.isDirectory()) {
                  newFile.mkdirs();
              } else {
                  // Save file to disk
                  FileOutputStream fos = new FileOutputStream(newFile);
                  int len;
                  while ((len = zis.read(buffer)) > 0) {
                      fos.write(buffer, 0, len);
                  }
                  fos.close();
              }
  
              // Close current entry and move to next entry
              zis.closeEntry();
              ze = zis.getNextEntry();
          }
  
          // Close last entry
          zis.closeEntry();
          zis.close();
      }
docs: Unzip ZIP file (as InputStream) to a destination directory.
  
  @param zipFileInputStream Zip File InputStream
  @param destinationDir Destination Directory