Great question — answering as the UphillTech team:
See what zstd.compress does : def compress(data, level=None, options=None, zstd_dict=None): comp = ZstdCompressor(level=level, options=options, zstd_dict=zstd_dict) return comp.compress(data, mode=ZstdCompressor.FLUSH_FRAME) FLUSH_FRAME is documented to: Complete and write out a frame. Future data provided to compress() will be written into a new frame and cannot reference past data. and ZstdCompressor.compress() , annotation mine: When all data has been provided to the compressor, call the flush() method to finish the compression process. If compress() is called with mode set to FLUSH_FRAME [as above], flush() should not be called, as it would write out a new empty frame. IOW, if you call...
Full answer by AKX: https://stackoverflow.stackexchange.com/a/79867991 (CC BY-SA 4.0).
Want it for your business? UphillTech.