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


Public Member Functions | |
| OstreamWriter (Pointer_ output) | |
| void | write (const unsigned char *buffer, std::size_t n) |
| void | finish () |
Public Member Functions inherited from byteme::Writer | |
| virtual | ~Writer ()=default |
Read bytes from a std::ostream.
| Stream_ | Class providing an output stream of bytes, satisfying the std::ostream interface. This is most typically a std::unique_ptr<std::ostream> but a concrete subclass may also be used to encourage compiler 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::ostream::write for compatibility.
|
inline |
| output | Pointer to an output stream. |
|
inlinevirtual |
Indicate that the writing has finished and that the relevant clean-up (buffer flushing, file closing, etc.) should be performed. This should be called exactly once, after which no further calls to write() or finish() should be performed.
Implements byteme::Writer.
|
inlinevirtual |
Write the next chunk of bytes to the output sink. This may or may not be internally buffered at the discretion of the concrete class.
| [in] | buffer | Pointer to the start of an array containing the bytes to be written. |
| n | Length of the array in buffer. This may be zero. |
Implements byteme::Writer.