definition of a byte chunk, which is the unit of data exchanged during I/O and data transformation operations
A dynamic type of input range of chunks of bytes
Type of delegate to use as callback for Inflate.gzHeaderDg
Copy algorithm do not transform data at all This is useful in cases of reading/writing data that may or may not be compressed. Using Copy allows that the same code handles both kind of streams.
Exception thrown when inconsistent data is given to a decompression algorithm. I.e. the data was not compressed with the corresponding algorithm or the wrapping format is not the one expected.
Integrity check to include in the compressed data (only for the Xz format) Default for xz is CRC-64.
Filters to use with the LZMA compression.
Header/trailer format for Lzma compression
Describe what type of header and trailer are wrapping a deflated stream.
Returns an InputRange containing the input data processed through Bzip2 compression.
Copy algorithm do not transform data at all This is useful in cases of reading/writing data that may or may not be compressed. Using Copy allows that the same code handles both kind of streams.
Returns an InputRange streaming over data decompressed with Bzip2.
Returns an InputRange containing the input data processed through Zlib's deflate algorithm. The produced stream of data is wrapped by Zlib header and trailer.
Returns an InputRange containing the input data processed through Zlib's deflate algorithm. The produced stream of data is wrapped by Gzip header and trailer. Suppliying a header is entirely optional. Zlib produces a default header if not supplied. The default header has text false, mtime zero, unknown os, and no name or comment.
Returns an InputRange containing the input data processed through Zlib's deflate algorithm. The produced stream of data isn't wrapped by any header or trailer.
Returns an InputRange streaming over data inflated with Zlib. The input data must be deflated with a zlib format.
Returns an InputRange streaming over data inflated with Zlib. The input data must be deflated with a gz format. If headerDg is not null, it will be called as soon as the header is read from the stream.
Returns an InputRange streaming over data inflated with Zlib. The input must be raw deflated data
Whether this is a legacy format
Whether this is a raw format
Helper to set GzHeader.text Will check if the data are all ascii characters
Returns an InputRange containing the input data processed through the supplied algorithm.
Get a runtime type for the provided algorithm
Same as squiz, but will stop encoding/decoding after len bytes has been written out Useful to decode some raw encoded streams where the uncompressed size is known and the algorithm not always report Yes.streamEnded.
Returns an InputRange containing the input data processed through the supplied algorithm. To the difference of squiz, squizReuse will not manage the state (aka stream) of the algorithm, which allows to reuse it (and its allocated resources) for several jobs. squizReuse will drive the algorithm and move the stream forward until processing is over. The stream must be either freshly initialized or freshly reset before being passed to this function.
A squiz algorithm whom type is erased behind an interface. This helps to choose algorithm at run time.
A state carrying, processing stream for squiz algorithms. The stream does not carry any buffer, only slices to external buffer. One may normally not use this directly as everything is handled by the squiz function.
default chunk size for data exchanges and I/O operations
Compression with the Bzip2 algorithm.
Zstandard is a fast compression algorithm designed for streaming. See zstd.h (enum ZSTD_cParameter) for details.
Copy algorithm do not transform data at all This is useful in cases of reading/writing data that may or may not be compressed. Using Copy allows that the same code handles both kind of streams.
Decompression of data encoded with Bzip2.
Zlib's deflate algorithm
Header data for the Gzip format. Gzip includes metadata about the file which is compressed. These can be specified here when compressing from a stream rather than directly from a file.
Zlib's inflate algorithm
Get the type of a SquizStream for the Squiz algorithm
Static check that a type is a byte range.
Check whether a type is a proper squiz algorithm.
Compression and decompression streaming algorithms.
Each compression or decompression algorithm is represented by a struct that contains parameters for compression/decompression. Besides the parameters they carry, algorithms have no state. Each algorithm instance can be used for an unlimited number of parallel jobs.
The algorithms create a stream, which carry the state and allocated resources of the ongoing compression.
The compression/decompression jobs are run by the squiz function, or one of the related helpers built upon it (e.g. deflate, deflateGz, inflate, ...).
squiz and related functions take and InputRange of ubyte[] and return an InputRange of ubyte[]. This allows streaming in the most natural way for a D program and provide the greatest versatility. It is possible to read the data from any source (file, network, memory), process the data, and write to any kind of destination. This also allows to process gigabytes of data with little memory usage.
Compression often wraps the compressed data with header and trailer that give the decompression algorithm useful information, especially to check the integrity of the data after decompression. This is called the format. Some compressions algorithms offer different formats, and sometimes the possibility to not wrap the data at all (raw format), in which case integrity check is not performed. This is usually used when an external integrity check is done, for example when archiving compressed stream in Zip or 7z archives.