| 287 | } |
| 288 | |
| 289 | bool zlib_stream::zlib_compress(const char* in, int len, string* out, |
| 290 | zlib_level_t level /* = zlib_default */) |
| 291 | { |
| 292 | if (!zip_begin(level)) { |
| 293 | zip_reset(); |
| 294 | return false; |
| 295 | } |
| 296 | |
| 297 | if (!zip_update(in, len, out, zlib_flush_sync)) { |
| 298 | zip_reset(); |
| 299 | return false; |
| 300 | } |
| 301 | |
| 302 | return zip_finish(out); |
| 303 | } |
| 304 | |
| 305 | bool zlib_stream::zlib_uncompress(const char* in, int len, string* out, |
| 306 | bool have_zlib_header /* = true */, int wsize /* = 15 */) |
no outgoing calls