|
byteme
Read/write bytes from various sources
|
Compress and write bytes to a Zlib-compressed buffer. More...
#include <ZlibBufferWriter.hpp>


Public Member Functions | |
| ZlibBufferWriter (const ZlibBufferWriterOptions &options) | |
| void | write (const unsigned char *buffer, std::size_t n) |
| void | finish () |
| std::vector< unsigned char > & | get_output () |
Public Member Functions inherited from byteme::Writer | |
| virtual | ~Writer ()=default |
Compress and write bytes to a Zlib-compressed buffer.
This is basically a wrapper around Zlib's deflate method, with correct closing and error checking.
|
inline |
| options | Further options. |
|
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.
|
inline |
finish() is called.
|
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.