Changed gzip buffer to heap instead of stack