Icicle\Http\Stream\ZlibDecoder::__construct PHP Метод

__construct() публичный Метод

public __construct ( integer $type, integer $hwm )
$type integer Compression type. Use GZIP or DEFLATE constants defined in this class.
$hwm integer
    public function __construct(int $type, int $hwm = 0)
    {
        // @codeCoverageIgnoreStart
        if (!extension_loaded('zlib')) {
            throw new UnsupportedError('zlib extension required to decode compressed streams.');
        }
        // @codeCoverageIgnoreEnd
        parent::__construct($hwm);
        switch ($type) {
            case self::GZIP:
            case self::DEFLATE:
                $this->resource = inflate_init($type);
                break;
            default:
                throw new InvalidArgumentError('Invalid compression type.');
        }
        if (null === $this->resource) {
            throw new FailureException('Could not initialize inflate handle.');
        }
    }