lib/core: add no-overhead read_bytes implementation
authorLucas Bajolet <lucas.bajolet@gmail.com>
Wed, 25 Apr 2018 20:27:31 +0000 (16:27 -0400)
committerLucas Bajolet <lucas.bajolet@gmail.com>
Tue, 1 May 2018 21:36:56 +0000 (17:36 -0400)
commit15975d0c322469baae34ad8882d1dbb9f5e4bd4a
treec418473fa405751490de68f70fb07d98e76bd9ae
parent1b6e85e2b8d5e69e2750ae0f5e56dee6cb28f2c6
lib/core: add no-overhead read_bytes implementation

read_bytes as a simple interface is relevant, but may hinder
performances in case a chunk is repeatedly read and discarded as for
each read operation, a buffer is re-allocated.

A secondary read operation is introduced to read directly to a CString,
using closer-to-C semantics.

Also start using codec lookahead as source for reading bytes.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>
lib/bitmap/bitmap.nit
lib/core/exec.nit
lib/core/file.nit
lib/core/stream.nit