compression
Provides utilities for compressing/decompressing byte streams.
Provides utilities for compressing/decompressing byte streams.
Type members
Classlikes
Deflate algorithm parameters.
Deflate algorithm parameters.
- Companion
- object
Gunzip decompression results including file properties and decompressed content stream, used as follows: stream .through(gunzipIO) .flatMap { gunzipResult => // Access properties here. gunzipResult.content }
Gunzip decompression results including file properties and decompressed content stream, used as follows: stream .through(gunzipIO) .flatMap { gunzipResult => // Access properties here. gunzipResult.content }
- Value Params
- comment
File comment.
- content
Uncompressed content stream.
- fileName
File name.
- modificationTime
Modification time of compressed file.
Inflate algorithm parameters.
Inflate algorithm parameters.
- Companion
- object
Value members
Concrete methods
Returns a Pipe
that deflates (compresses) its input elements using
a java.util.zip.Deflater
with the parameters level
, nowrap
and strategy
.
Parameter flush mode is set to NO_FLUSH - use compression.deflate(DeflateParams)
to configure this.
Returns a Pipe
that deflates (compresses) its input elements using
a java.util.zip.Deflater
with the parameters level
, nowrap
and strategy
.
Parameter flush mode is set to NO_FLUSH - use compression.deflate(DeflateParams)
to configure this.
- Value Params
- bufferSize
size of the internal buffer that is used by the compressor. Default size is 32 KB.
- level
the compression level (0-9)
- nowrap
if true then use GZIP compatible compression
- strategy
compression strategy -- see
java.util.zip.Deflater
for details
Returns a Pipe
that deflates (compresses) its input elements using
the the Deflate algorithm.
Returns a Pipe
that deflates (compresses) its input elements using
the the Deflate algorithm.
- Value Params
- deflateParams
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 Params
- 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.
- Returns
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 Params
- inflateParams
- Returns
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 Params
- 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
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 Params
- comment
optional file comment
- deflateParams
- fileName
optional file name
- modificationTime
optional file modification time
Returns a Pipe
that inflates (decompresses) its input elements using
a java.util.zip.Inflater
with the parameter nowrap
.
Returns a Pipe
that inflates (decompresses) its input elements using
a java.util.zip.Inflater
with the parameter nowrap
.
- Value Params
- bufferSize
size of the internal buffer that is used by the decompressor. Default size is 32 KB.
- nowrap
if true then support GZIP compatible decompression