Amp\Artax\Client::inflateGzipBody PHP Method

inflateGzipBody() private method

private inflateGzipBody ( Amp\Artax\Response $response )
$response Amp\Artax\Response
    private function inflateGzipBody(Response $response)
    {
        $src = $response->getBody();
        if (is_resource($src)) {
            $destination = fopen('php://memory', 'r+');
            fseek($src, 10, SEEK_SET);
            stream_filter_prepend($src, 'zlib.inflate', STREAM_FILTER_READ);
            stream_copy_to_stream($src, $destination);
            rewind($destination);
            $response->setBody($destination);
        } elseif (strlen($src)) {
            $body = gzdecode($src);
            $response->setBody($body);
        }
    }