Neos\Flow\ResourceManagement\Collection::getStreamByResource PHP Method

getStreamByResource() public method

Returns a stream handle of the given persistent resource which allows for opening / copying the resource's data. Note that this stream handle may only be used read-only.
public getStreamByResource ( PersistentResource $resource ) : resource | boolean
$resource PersistentResource The resource to retrieve the stream for
return resource | boolean | boolean The resource stream or FALSE if the stream could not be obtained
    public function getStreamByResource(PersistentResource $resource)
    {
        $stream = $this->getStorage()->getStreamByResource($resource);
        if ($stream !== false) {
            $meta = stream_get_meta_data($stream);
            if ($meta['seekable']) {
                rewind($stream);
            }
        }
        return $stream;
    }