diff options
author | Pierre Ossman <ossman@cendio.se> | 2022-08-24 10:31:42 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2022-08-25 12:21:15 +0200 |
commit | 79329c0a8fc6889ec2f70db5992db74f5f92c573 (patch) | |
tree | f897cf3d5a76b55f878d17c45f0028c41389f7a7 /common/rdr/HexOutStream.h | |
parent | d67657e67dde9e0b156d1dae82dacaf8713cdb66 (diff) | |
download | tigervnc-79329c0a8fc6889ec2f70db5992db74f5f92c573.tar.gz tigervnc-79329c0a8fc6889ec2f70db5992db74f5f92c573.zip |
Use BufferedOutStream in more streams
Avoid duplicating all the memory mangement, and instead use the
BufferedOutStream as a base clase for all out streams that need an
intermediate buffer.
Diffstat (limited to 'common/rdr/HexOutStream.h')
-rw-r--r-- | common/rdr/HexOutStream.h | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/common/rdr/HexOutStream.h b/common/rdr/HexOutStream.h index e591dd88..8b1ab9ec 100644 --- a/common/rdr/HexOutStream.h +++ b/common/rdr/HexOutStream.h @@ -19,32 +19,27 @@ #ifndef __RDR_HEX_OUTSTREAM_H__ #define __RDR_HEX_OUTSTREAM_H__ -#include <rdr/OutStream.h> +#include <rdr/BufferedOutStream.h> namespace rdr { - class HexOutStream : public OutStream { + class HexOutStream : public BufferedOutStream { public: HexOutStream(OutStream& os); virtual ~HexOutStream(); - void flush(); - size_t length(); + virtual void flush(); virtual void cork(bool enable); static char intToHex(int i); static char* binToHexStr(const char* data, size_t length); private: + virtual bool flushBuffer(); void writeBuffer(); - virtual void overrun(size_t needed); OutStream& out_stream; - - U8* start; - size_t offset; - size_t bufSize; }; } |