File
- drupal/core/vendor/guzzle/http/Guzzle/Http/EntityBody.php, line 200
Class
- EntityBody
- Entity body used with an HTTP request or response
Namespace
Guzzle\Http
Code
protected function handleCompression($filter, $offsetStart = 0) {
if (!$this
->isReadable() || $this
->isConsumed() && !$this
->isSeekable()) {
return false;
}
$handle = fopen('php://temp', 'r+');
$filter = @stream_filter_append($handle, $filter, STREAM_FILTER_WRITE);
if (!$filter) {
return false;
}
$this
->seek($offsetStart);
while ($data = fread($this->stream, 8096)) {
fwrite($handle, $data);
}
fclose($this->stream);
$this->stream = $handle;
stream_filter_remove($filter);
$stat = fstat($this->stream);
$this->size = $stat['size'];
$this
->rebuildCache();
$this
->seek(0);
$this->rewindFunction = null;
return true;
}