Add decompression command

This commit is contained in:
topjohnwu
2019-02-23 16:53:51 -05:00
parent 1d3ce9fef1
commit 340bac7e42
2 changed files with 29 additions and 2 deletions

View File

@ -64,14 +64,20 @@ public:
return true;
}
template <typename T>
void release(void *&b, T &len) {
template <typename bytes, typename length>
void release(bytes *&b, length &len) {
b = buf;
len = off;
buf = nullptr;
off = cap = 0;
}
template <typename bytes, typename length>
void getbuf(bytes *&b, length &len) const {
b = buf;
len = off;
}
~BufOutStream() override {
free(buf);
}