1#ifndef BYTEME_ISTREAM_READER_HPP
2#define BYTEME_ISTREAM_READER_HPP
30template<
class Po
inter_>
39 std::size_t
read(
unsigned char* buffer, std::size_t n) {
40 return safe_read<std::streamsize>(buffer, n, [
this](
unsigned char* buffer, std::streamsize n) -> std::streamsize {
41 my_input->read(
reinterpret_cast<char*
>(buffer), n);
42 const auto my_read = my_input->gcount();
44 if (!(my_input->eof())) {
45 throw std::runtime_error(
"failed to finish reading the input stream");
Read bytes from a std::istream.
Definition IstreamReader.hpp:31
IstreamReader(Pointer_ input)
Definition IstreamReader.hpp:36
std::size_t read(unsigned char *buffer, std::size_t n)
Definition IstreamReader.hpp:39
Virtual class for reading bytes from a source.
Definition Reader.hpp:17
Simple byte readers and writers.
Definition BufferedReader.hpp:21