public function toStream($stream)
    {
        $bytesWritten = 0;
        foreach ($this->getChunkCursor() as $chunk) {
            $bytesWritten += fwrite($stream, $chunk['data']->getData());
        }
        return $bytesWritten;
    }
public function toStream($stream)
    {
        $bytesWritten = 0;
        foreach ($this->getChunkCursor() as $chunk) {
            $bytesWritten += fwrite($stream, $chunk['data']->getData());
        }
        return $bytesWritten;
    }
public function toStream ( $ stream ) { $ bytesWritten = 0 ; foreach ( $ this -> getChunkCursor ( ) as $ chunk ) { $ bytesWritten += fwrite ( $ stream , $ chunk [ 'data' ] -> getData ( ) ) ; } return $ bytesWritten ; }
Saves file into the given stream.
@param resource $stream stream, which file should be saved to.
@return int number of written bytes.
Saves file into the given stream .