wip: vfs implementation

This commit is contained in:
2025-11-27 20:49:58 +00:00
parent c0e2f7ff37
commit b1e34f878c
9 changed files with 466 additions and 36 deletions

View File

@@ -0,0 +1,22 @@
package virtualfs
import "io"
type CountingReader struct {
reader io.Reader
count int64
}
func NewCountingReader(reader io.Reader) *CountingReader {
return &CountingReader{reader: reader}
}
func (r *CountingReader) Read(p []byte) (n int, err error) {
n, err = r.reader.Read(p)
r.count += int64(n)
return n, err
}
func (r *CountingReader) Count() int64 {
return r.count
}