It's kind of unfortunate that we need to make a copy of the buffer here, because `Deflater` will only operate on arrays. But I don't see any way around that.