1 <?php
2
3 namespace Http\Message\Encoding;
4
5 /**
6 * Decorate a stream which is chunked.
7 *
8 * Allow to decode a chunked stream
9 *
10 * @author Joel Wurtz <joel.wurtz@gmail.com>
11 */
12 class DechunkStream extends FilteredStream
13 {
14 /**
15 * {@inheritdoc}
16 */
17 public function getReadFilter()
18 {
19 return 'dechunk';
20 }
21
22 /**
23 * {@inheritdoc}
24 */
25 public function getWriteFilter()
26 {
27 if (!array_key_exists('chunk', stream_get_filters())) {
28 stream_filter_register('chunk', 'Http\Message\Encoding\Filter\Chunk');
29 }
30
31 return 'chunk';
32 }
33 }
34