Compression

fs2.compression.Compression
See theCompression companion object
sealed trait Compression[F[_]]

Provides the capability to compress/decompress using deflate and gzip. On JVM an instance is available given a Sync[F]. On Node.js an instance is available for Async[F] by importing fs2.io.compression._.

Attributes

Companion
object
Source
Compression.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

Attributes

Source
Compression.scala

Returns a pipe that incrementally decompresses input according to the GZIP format as defined by RFC 1952 at https://www.ietf.org/rfc/rfc1952.txt. Any errors in decompression will be sequenced as exceptions into the output stream. Decompression is handled in a streaming and async fashion without any thread blockage.

Returns a pipe that incrementally decompresses input according to the GZIP format as defined by RFC 1952 at https://www.ietf.org/rfc/rfc1952.txt. Any errors in decompression will be sequenced as exceptions into the output stream. Decompression is handled in a streaming and async fashion without any thread blockage.

The chunk size here is actually really important. Matching the input stream largest chunk size, or roughly 8 KB (whichever is larger) is a good rule of thumb.

Value parameters

inflateParams

See compression.InflateParams

Attributes

Returns

See compression.GunzipResult

Source
Compression.scala

Attributes

Source
Compression.scala

Concrete methods

Returns a pipe that incrementally decompresses input according to the GZIP format as defined by RFC 1952 at https://www.ietf.org/rfc/rfc1952.txt. Any errors in decompression will be sequenced as exceptions into the output stream. Decompression is handled in a streaming and async fashion without any thread blockage.

Returns a pipe that incrementally decompresses input according to the GZIP format as defined by RFC 1952 at https://www.ietf.org/rfc/rfc1952.txt. Any errors in decompression will be sequenced as exceptions into the output stream. Decompression is handled in a streaming and async fashion without any thread blockage.

The chunk size here is actually really important. Matching the input stream largest chunk size, or roughly 8 KB (whichever is larger) is a good rule of thumb.

Value parameters

bufferSize

The bounding size of the input buffer. This should roughly match the size of the largest chunk in the input stream. This will also be the chunk size in the output stream. Default size is 32 KB.

Attributes

Returns

See compression.GunzipResult

Source
Compression.scala

Inherited methods

Returns a pipe that incrementally compresses input into the GZIP format as defined by RFC 1952 at https://www.ietf.org/rfc/rfc1952.txt. Output is compatible with the GNU utils gunzip utility, as well as really anything else that understands GZIP. Note, however, that the GZIP format is not "stable" in the sense that all compressors will produce identical output given identical input. Part of the header seeding is arbitrary and chosen by the compression implementation. For this reason, the exact bytes produced by this pipe will differ in insignificant ways from the exact bytes produced by a tool like the GNU utils gzip.

Returns a pipe that incrementally compresses input into the GZIP format as defined by RFC 1952 at https://www.ietf.org/rfc/rfc1952.txt. Output is compatible with the GNU utils gunzip utility, as well as really anything else that understands GZIP. Note, however, that the GZIP format is not "stable" in the sense that all compressors will produce identical output given identical input. Part of the header seeding is arbitrary and chosen by the compression implementation. For this reason, the exact bytes produced by this pipe will differ in insignificant ways from the exact bytes produced by a tool like the GNU utils gzip.

GZIP wraps a deflate stream with file attributes and stream integrity validation. Therefore, GZIP is a good choice for compressing finite, complete, readily-available, continuous or file streams. A simpler deflate stream may be better suited to real-time, intermittent, fragmented, interactive or discontinuous streams where network protocols typically provide stream integrity validation.

Value parameters

comment

optional file comment

deflateParams

see compression.DeflateParams

fileName

optional file name

modificationTime

optional file modification time

Attributes

Inherited from:
CompressionPlatform (hidden)
Source
CompressionPlatform.scala

Returns a pipe that incrementally compresses input into the GZIP format as defined by RFC 1952 at https://www.ietf.org/rfc/rfc1952.txt. Output is compatible with the GNU utils gunzip utility, as well as really anything else that understands GZIP. Note, however, that the GZIP format is not "stable" in the sense that all compressors will produce identical output given identical input. Part of the header seeding is arbitrary and chosen by the compression implementation. For this reason, the exact bytes produced by this pipe will differ in insignificant ways from the exact bytes produced by a tool like the GNU utils gzip.

Returns a pipe that incrementally compresses input into the GZIP format as defined by RFC 1952 at https://www.ietf.org/rfc/rfc1952.txt. Output is compatible with the GNU utils gunzip utility, as well as really anything else that understands GZIP. Note, however, that the GZIP format is not "stable" in the sense that all compressors will produce identical output given identical input. Part of the header seeding is arbitrary and chosen by the compression implementation. For this reason, the exact bytes produced by this pipe will differ in insignificant ways from the exact bytes produced by a tool like the GNU utils gzip.

GZIP wraps a deflate stream with file attributes and stream integrity validation. Therefore, GZIP is a good choice for compressing finite, complete, readily-available, continuous or file streams. A simpler deflate stream may be better suited to real-time, intermittent, fragmented, interactive or discontinuous streams where network protocols typically provide stream integrity validation.

Value parameters

bufferSize

The buffer size which will be used to page data into chunks. This will be the chunk size of the output stream. You should set it to be equal to the size of the largest chunk in the input stream. Setting this to a size which is ''smaller'' than the chunks in the input stream will result in performance degradation of roughly 50-75%. Default size is 32 KB.

comment

optional file comment

deflateLevel

level the compression level (0-9)

deflateStrategy

strategy compression strategy -- see java.util.zip.Deflater for details

fileName

optional file name

modificationTime

optional file modification time

Attributes

Inherited from:
CompressionPlatform (hidden)
Source
CompressionPlatform.scala