2 encoding stream brotli without flush
6 class_exists("http\\Encoding\\Stream\\Enbrotli") or die("SKIP need brotli support");
12 $defl = new http\Encoding\Stream\Enbrotli;
13 $infl = new http\Encoding\Stream\Debrotli;
14 $file = file(__FILE__);
16 foreach ($file as $line) {
17 if (strlen($temp = $defl->update($line))) {
18 foreach(str_split($temp) as $byte) {
19 $data .= $infl->update($byte);
23 if (strlen($temp = $defl->finish())) {
24 $data .= $infl->update($temp);
26 $data .= $infl->finish();
27 var_dump(implode("", $file) === $data);