ref: fdf1bd9a68091a1640b79fcb4ea979ed10f8b904
parent: beabb6085d42cbb961e3a5dc217fdd840fee4b0d
author: Runxi Yu <me@runxiyu.org>
date: Thu Mar 5 13:04:22 EST 2026
internal/compress/flate: Add InputConsumed
--- a/internal/compress/flate/inflate.go
+++ b/internal/compress/flate/inflate.go
@@ -286,6 +286,14 @@
io.ByteReader
}
+// InputProgress reports compressed input bytes consumed by inflate state.
+//
+// InputConsumed returns bytes that have been consumed by the decompressor's
+// parser and state machine, not bytes merely read ahead from the source.
+type InputProgress interface {+ InputConsumed() int64
+}
+
type step uint8
const (
@@ -342,6 +350,11 @@
final bool
flushMode flushMode
+}
+
+// InputConsumed returns compressed input bytes consumed by receiver.
+func (f *decompressor) InputConsumed() int64 {+ return f.roffset
}
func (f *decompressor) nextBlock() {--
⑨