Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTooLong = fmt.Errorf("the incoming sample data is too long")
Functions ¶
func LimitReader ¶
LimitReader returns a Reader that reads from r but stops with ErrTooLong after n bytes. The underlying implementation is a *LimitedReader.
func NewLimitReadCloser ¶
func NewLimitReadCloser(r io.ReadCloser, n int64) io.ReadCloser
Types ¶
type LimitedReader ¶
A LimitedReader reads from R but limits the amount of data returned to just N bytes. Each call to Read updates N to reflect the new amount remaining. Read returns ErrTooLong when N <= 0 or when the underlying R returns EOF.
Click to show internal directories.
Click to hide internal directories.