fs2
fs2 copied to clipboard
fs2 gunzip doesn't support concatenated gzip files
Steps to reproduce:
- generate a compressed file
echo foo > foo; echo bar > bar; gzip -c foo bar > foobar.gz
- run the following code
import cats.effect.IO
import cats.effect.unsafe.implicits.global
import fs2.compression.Compression
import java.io.FileInputStream
fs2.io
.readInputStream(
IO(new FileInputStream("foobar.gz")),
1024,
)
.through(Compression[IO].gunzip(1024))
.flatMap(_.content)
.compile
.drain
.unsafeRunSync()
This code snippet throws a java.util.zip.ZipException: Content failed CRC validation.
I expect it to run without error.
Tested on fs2 3.11.0
My gzip version is Apple gzip 430.140.2