Phalcon\Db\Adapter\MongoDB\GridFS\Bucket::downloadToStream PHP Method

downloadToStream() public method

Writes the contents of a GridFS file to a writable stream.
public downloadToStream ( mixed $id, resource $destination )
$id mixed File ID
$destination resource Writable Stream
    public function downloadToStream($id, $destination)
    {
        $file = $this->collectionWrapper->findFileById($id);
        if ($file === null) {
            throw FileNotFoundException::byId($id, $this->getFilesNamespace());
        }
        $stream = new ReadableStream($this->collectionWrapper, $file);
        $stream->downloadToStream($destination);
    }