Advanced Bzip2 parameters See Bzip2 documentation https://www.sourceware.org/bzip2/manual/manual.html#bzDecompress-init
Advanced Bzip2 parameters See Bzip2 documentation https://www.sourceware.org/bzip2/manual/manual.html#bzDecompress-init
import test.util; import std.array : join; const len = 100_000; const phrase = cast(const(ubyte)[]) "Some very repetitive phrase.\n"; const input = generateRepetitiveData(len, phrase).join(); const squized = only(input) .compressBzip2() .join(); const output = only(squized) .decompressBzip2() .join(); assert(squized.length < input.length); assert(output == input); // for such long and repetitive data, ratio is around 0.12% const ratio = cast(double) squized.length / cast(double) input.length; assert(ratio < 0.002);
Decompression of data encoded with Bzip2.
This algorithm does not support resource reuse, so calling reset is equivalent to a call to end followed by initialize. (but the same instance of stream is kept).