Mercurial > hg
comparison .clang-format @ 36362:01e29e885600
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
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 21 Feb 2018 13:41:20 -0800 |
parents | d0a3fa849cb8 |
children |
comparison
equal
deleted
inserted
replaced
36361:a2d11d23bb25 | 36362:01e29e885600 |
---|