Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for HardLimitReader (0.07 sec)

  1. 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.
    Registered: Sun Dec 28 19:28:13 UTC 2025
    - Last Modified: Sun Sep 28 20:59:21 UTC 2025
    - 2K bytes
    - Viewed (0)
  2. 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) {
    Registered: Sun Dec 28 19:28:13 UTC 2025
    - Last Modified: Mon Jan 20 14:49:07 UTC 2025
    - 1.8K bytes
    - Viewed (0)
Back to top