public static function castFrom($value): InputStream
    {
        if ($value instanceof InputStream) {
            return $value;
        }

        if (is_string($value)) {
            return new self($value);
        }

        throw new \InvalidArgumentException(
                'Given value is neither an instance of' . InputStream::class
                . ' nor a string denoting a file'
        );
    }