ocaml-batteries-team/batteries-included — pull request #522 by c-cube (2014-01-29 22:02:40+00:00)
Title: new module, batBufferIO: a circular, efficient buffer of bytes

Follow-up on #520, with my remark about buffering being very inefficient. In this case, and often when one needs to read bytes from a pipe, socket, etc. an efficient buffer is needed. So here is my proposal (to be reviewed, probably not yet ready for merge), a circular buffer that should be efficient for adding and removing big chunks of bytes, and also allows to iterate, pop next char, etc.