DecompressZstd

Undocumented in source.

Members

Classes

Stream
class Stream
Undocumented in source.

Functions

end
void end(Stream stream)
Undocumented in source. Be warned that the author may not have intended to support it.
initialize
Stream initialize()
Undocumented in source. Be warned that the author may not have intended to support it.
process
Flag!"streamEnded" process(Stream stream, Flag!"lastChunk" )
Undocumented in source. Be warned that the author may not have intended to support it.
reset
void reset(Stream stream)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

windowLogMax
int windowLogMax;
Undocumented in source.

Examples

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)
    .compressZstd()
    .join();

const output = only(squized)
    .decompressZstd()
    .join();

assert(squized.length < input.length);
assert(output == input);

// for such long and repetitive data, ratio is around 0.047%
const ratio = cast(double) squized.length / cast(double) input.length;
assert(ratio < 0.0005);

Meta