Avoid copying data in a buffer by using several deflate() calls