All Downloads are FREE. Search and download functionalities are using the official Maven repository.

coursier.launcher.internal.Zip.scala Maven / Gradle / Ivy

There is a newer version: 2.1.13
Show newest version
package coursier.launcher.internal

import java.util.zip.{ZipEntry, ZipFile}

import scala.jdk.CollectionConverters._

private[coursier] object Zip {

  def zipEntries(zipFile: ZipFile): Iterator[(ZipEntry, Array[Byte])] =
    zipFile.entries().asScala.map { ent =>
      val data = FileUtil.readFully(zipFile.getInputStream(ent))

      // Doing this like above just in case
      ent.setCompressedSize(-1L)

      (ent, data)
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy