class
Amber::Pipe::Compression::Deflater
- Amber::Pipe::Compression::Deflater
- Reference
- Object
Overview
One raw DEFLATE stream whose zlib state and output buffer live outside the garbage-collected heap, so it can compress one response after another without allocating.
It uses the settings Compress::Deflate::Writer uses (raw DEFLATE,
15 window bits, memory level 8, the default strategy), so its output
is byte for byte the same.
:nodoc:
Defined in:
amber/pipes/compression/deflater.crConstant Summary
-
OUTPUT_BUFFER_BYTES =
8192
Constructors
Instance Method Summary
-
#finalize
A compressor dropped without
#release(a response that never closed) still frees its memory when it is collected. -
#finish(output : IO) : Nil
Ends the stream and writes its last bytes.
-
#flush(output : IO) : Nil
Writes everything compressed so far, ending on a byte boundary.
-
#release : Nil
Frees the zlib state and the output buffer.
-
#reset : Nil
Readies the stream for the next response, keeping its memory.
-
#write(slice : Bytes, output : IO) : Nil
Compresses slice into output, keeping zlib's own buffering.
Constructor Detail
Instance Method Detail
A compressor dropped without #release (a response that never
closed) still frees its memory when it is collected.
Compresses slice into output, keeping zlib's own buffering.