blob: 1d7344bac227f43d5d2278f9f3ef9dd494f1b217 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
<?php
namespace Http\Message\Encoding;
use Psr\Http\Message\StreamInterface;
/**
* Stream deflate (RFC 1951).
*
* @author Joel Wurtz <joel.wurtz@gmail.com>
*/
class DeflateStream extends FilteredStream
{
/**
* @param StreamInterface $stream
* @param int $level
*/
public function __construct(StreamInterface $stream, $level = -1)
{
parent::__construct($stream, ['window' => -15, 'level' => $level], ['window' => -15]);
}
/**
* {@inheritdoc}
*/
protected function readFilter()
{
return 'zlib.deflate';
}
/**
* {@inheritdoc}
*/
protected function writeFilter()
{
return 'zlib.inflate';
}
}
|