Yes, it was c+p from here http://windrealm.org/tutorials/decompress-gzip-stream.php. I will add the copyright.