deflate and inflate from buffers