deflate ( bytes -- bytes' )
Raw DEFLATE compression

Next:inflate ( bytes -- bytes' )


Vocabulary
compression.deflate

Inputs
bytesa byte-array


Outputs
bytes'a byte-array


Word description
Compresses a byte array into a raw RFC 1951 DEFLATE stream. Uses LZ77 matches with a 32 KiB window and fixed Huffman codes, falling back to stored blocks when they are smaller. The result has no gzip or zlib header or checksum.

Definition


:: deflate ( bytes -- bytes' )
bytes fixed-deflate :> compressed bytes length dup 65534 +
65535 /i 1 max 5 * + compressed length <
[ bytes stored-deflate ] [ compressed ] if ;