summaryrefslogtreecommitdiff
path: root/vendor/github.com/klauspost/compress/s2/reader.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/klauspost/compress/s2/reader.go')
-rw-r--r--vendor/github.com/klauspost/compress/s2/reader.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/vendor/github.com/klauspost/compress/s2/reader.go b/vendor/github.com/klauspost/compress/s2/reader.go
index 8b84baa6d..2f01a3987 100644
--- a/vendor/github.com/klauspost/compress/s2/reader.go
+++ b/vendor/github.com/klauspost/compress/s2/reader.go
@@ -147,6 +147,13 @@ type Reader struct {
ignoreCRC bool
}
+// GetBufferCapacity returns the capacity of the internal buffer.
+// This might be useful to know when reusing the same reader in combination
+// with the lazy buffer option.
+func (r *Reader) GetBufferCapacity() int {
+ return cap(r.buf)
+}
+
// ensureBufferSize will ensure that the buffer can take at least n bytes.
// If false is returned the buffer exceeds maximum allowed size.
func (r *Reader) ensureBufferSize(n int) bool {