|
byteme
Read/write bytes from various sources
|
Read bytes from a std::istream.
More...
#include <IstreamReader.hpp>


Public Member Functions | |
| IstreamReader (Pointer_ input) | |
| std::size_t | read (unsigned char *buffer, std::size_t n) |
Public Member Functions inherited from byteme::Reader | |
Read bytes from a std::istream.
| Pointer_ | Pointer to a class providing an input stream of bytes, satisfying the std::istream interface. This is most typically a std::unique_ptr<std::istream> but a pointer to a concrete subclass may also be used to encourage devirtualization. Either a raw or smart pointer may be used depending on how the lifetime of the pointed-to object is managed. |
This is just a wrapper around std::istream::read, mostly to avoid having to remember the correct way to check for end of file.
|
inline |
| input | Pointer to an input stream. |
|
inlinevirtual |
Read the specified number of bytes from the source into a user-supplied buffer.
| [out] | buffer | Pointer to an array of at least length n. |
| n | Maximum number of bytes to extract from the source. This may be zero. |
n. If less than n, the stream of bytes from the source is finished and no more calls to read() should be performed. Implements byteme::Reader.