Documentation
¶
Overview ¶
Package iolimit provides small internal reader wrappers for length-constrained stream I/O.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrExpectedLengthExceeded = errors.New("iolimit: stream exceeded expected length")
ErrExpectedLengthExceeded reports that a stream produced bytes beyond the expected length.
Functions ¶
func ExpectLengthReader ¶
ExpectLengthReader wraps src and enforces an expected byte length.
It returns io.ErrUnexpectedEOF if src ends before expected bytes are read. It returns ErrExpectedLengthExceeded if reads continue beyond the expected boundary and src still produces bytes.
This reader does not drain src on close or at the expected boundary. As a result, overlength streams are detected only when a caller reads at or past the boundary.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.