encode

zlib-wrap a DEFLATE compression of data (PDF FlateDecode form). Header is the conventional 0x78 0x9C (32 KiB window, default level, no preset dictionary; passes the mod-31 check), and the Adler-32 of the original data is appended big-endian. Round-trips through decode.