mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
This commit works around #18967 by adding an `AccumulatingReader`, which accumulates data read from the underlying packfile, and by keeping track of the position in the packfile and hash/checksum information separately rather than using reader composition. That is, the packfile position and hashes/checksums are updated with the accumulated read history data only after we can determine what data has actually been used by the decompressor rather than merely being buffered. The only addition to the standard library APIs to support this change is the `unreadBytes` function in `std.compress.flate.Inflate`, which allows the user to determine how many bytes have been read only for buffering and not used as part of compressed data. These changes can be reverted if #18967 is resolved with a decompressor that reads precisely only the number of bytes needed for decompression. |
||
|---|---|---|
| .. | ||
| flate | ||
| lzma | ||
| lzma2 | ||
| testdata | ||
| xz | ||
| zstandard | ||
| flate.zig | ||
| gzip.zig | ||
| lzma.zig | ||
| lzma2.zig | ||
| xz.zig | ||
| zlib.zig | ||
| zstandard.zig | ||