Scala 当我写zipInputStream时,在S3中得到一个0KB的文件

Scala 当我写zipInputStream时,在S3中得到一个0KB的文件,scala,stream,Scala,Stream,我有下面一段代码,它在S3中生成0KB的文件,下面的代码有什么问题 def extractFilesFromZipStream(zipInputStream: ZipArchiveInputStream, tgtPath: String, storageType:String): scala.collection.mutable.Map[String, (String, Long)] = { var filePathMap

我有下面一段代码,它在S3中生成0KB的文件,下面的代码有什么问题

def extractFilesFromZipStream(zipInputStream: ZipArchiveInputStream,
                                tgtPath: String, storageType:String): scala.collection.mutable.Map[String, (String, Long)] = {

    var filePathMap = scala.collection.mutable.Map[String, (String, Long)]()
    Try {
      storageWrapper.mkDirs(tgtPath)
      Stream.continually(zipInputStream.getNextZipEntry).takeWhile(_ != null).foreach {file =>

        val storagePathFilePath = s"$tgtPath/${file.getName}"

       storageWrapper.write(zipInputStream, storagePathFilePath)

        LOGGER.info(storagePathFilePath)
        val lineCount = Source.fromInputStream(storageWrapper.read(storagePathFilePath)).getLines().count(s => s!= null)

存储包装器没有什么问题,它采用了一个输入流和路径,到目前为止一直运行良好。有人能告诉我使用zipArchive Stream的实现有什么问题吗。

storageWrapper.write(zipInputStream,storagePathFilePath)做了什么?它在目标中写入一个0 KB的文件,即storagePathFilePath,这就是您想要的吗?我认为您错过了将文件内容写入磁盘的步骤。
文件的类型是什么?它是否没有一个
InputStream
来读取其内容?