##// END OF EJS Templates
util: add a file object proxy that can read at most N bytes...
util: add a file object proxy that can read at most N bytes Sometimes we have data of a known size within a stream. For performance reasons, we don't want to pre-read this data (we want to allow consumers to read on demand). For simplicitly reasons, we don't want callers to necessarily know their data is coming from within an outer stream and there is a limit to how much they should read. The class introduced by this commit provides a very simple proxy around an underlying file object that allows the consumer to .read() up to N bytes from the file object. Attempts to read past this many bytes results in a simulated EOF. Differential Revision: https://phab.mercurial-scm.org/D2377
Gregory Szorc -
r36382:01e29e88 default
Show More
Name Size Modified Last Commit Author
/ mercurial / httpclient
__init__.py Loading ...
_readers.py Loading ...