public function openStream(string $mode): StreamInterface
    {
        try {
            $res = Thrower::call('fopen', $this, $mode);
        } catch (\Exception $e) {
            throw new \RuntimeException(sprintf('Unable to open %s using mode "%s"', $this, $mode), 0, $e);
        }

        return StreamFactoryDiscovery::find()->createStream($res);
    }