Deflate overlapping copy 2026-10-14
In a Deflate overlapping copy, : some source bytes are created by the very copy being decoded. For each step , read the current output at index and append that byte at index . Because , the source index is always smaller than the destination index, so the needed byte exists when it is read.[ref]
DEFLATE Compressed Data Format Specification version 1.3 by L. Peter Deutsch. RFC 1951, section 3.2.3, printed p. 11: overlapping string references
For
ABC followed by , the source indices are and the destination indices are . Steps 0 through 2 copy the original ABC; steps 3 through 5 copy the ABC just appended; steps 6 through 8 copy the next newly appended ABC. Thus the final output is exactly ABCABCABCABC. Taking a snapshot of the original three-byte source slice would produce only three bytes; that operation does not implement the specified nine-byte copy.The reusable idea is a short description of periodic continuation: the decoder repeatedly looks a fixed distance behind its growing output. A Deflate backreference can also reach across a Deflate block framing boundary. Changing the block's Huffman codes does not by itself erase the decoded history.[ref]
DEFLATE Compressed Data Format Specification version 1.3 by L. Peter Deutsch. RFC 1951, sections 2 and 3.2.3: independent block codes, references across blocks
