- Sort Score
- Num 10 results
- Language All
Results 1 - 2 of 2 for HardLimitReader (0.07 seconds)
-
internal/ioutil/hardlimitreader.go
// by the standard library. package ioutil import ( "errors" "io" ) // ErrOverread is returned to the reader when the hard limit of HardLimitReader is exceeded. var ErrOverread = errors.New("input provided more bytes than specified") // HardLimitReader returns a Reader that reads from r // but returns an error if the source provides more data than allowed.
Created: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Sun Sep 28 20:59:21 GMT 2025 - 2K bytes - Click Count (0) -
internal/hash/checker.go
// Calling Close on this will close upstream. func NewChecker(rc io.ReadCloser, h hash.Hash, wantSum []byte, length int64) *Checker { return &Checker{c: rc, r: ioutil.HardLimitReader(rc, length), h: h, want: wantSum} } // Read satisfies io.Reader func (c Checker) Read(p []byte) (n int, err error) { n, err = c.r.Read(p) if n > 0 { c.h.Write(p[:n]) } if errors.Is(err, io.EOF) {
Created: Sun Dec 28 19:28:13 GMT 2025 - Last Modified: Mon Jan 20 14:49:07 GMT 2025 - 1.8K bytes - Click Count (0)