I am trying to stream a zip file.
The following chunk of code prints line by line as expected:
val inputStream = new GZIPInputStream(new FileInputStream("/some/path"))
val source = Source.fromInputStream(inputStream)
for(line <- source.getLines) {
println(line)
}
But this one doesn't do anyting (it doesn't even exit):
val inputStream = new ZipInputStream(new FileInputStream("/some/path"))
val source = Source.fromInputStream(inputStream)
for(line <- source.getLines) {
println(line)
}
The only difference is the usage of GZIPInputStream
instead of ZipInputStream
. Both class implements InputStream
.
Am I missing something ? Or is there any workaroud ?