The implementation permits to read from a buffer or from a file.
To read from a buffer, we should call create_reader_buffer.
For a file it's create_reader_fd.
The underlying method called to effectively read from the source is hidden. To read with a t_reader we just may call reader_read with a pointer to the t_reader, the destination buffer in which we want to write the data, and the length of data we want to put in destination buffer.
The implementation permits to read from a buffer or from a file. To read from a buffer, we should call
create_reader_buffer
. For a file it'screate_reader_fd
. The underlying method called to effectively read from the source is hidden. To read with at_reader
we just may callreader_read
with a pointer to thet_reader
, the destination buffer in which we want to write the data, and the length of data we want to put in destination buffer.We wrote tests to assert implementation quality.
It closes #2 issue.