Tale\Jade\Renderer\Adapter\Stream\Wrapper::stream_read PHP Method

stream_read() public method

(opened) stream (e.g. fread, fgets, fgetcsv, INCLUDE(!!!) etc.) We return the fitting chunk of our PHTML and add that length of that to our current position so that the next call will read the next chunk, rinse and repeat
public stream_read ( integer $length ) : string
$length integer the length of the chunk to read
return string
    public function stream_read($length)
    {
        //Abstract mb_* functions
        $substr = function_exists('mb_substr') ? 'mb_substr' : 'substr';
        $strlen = function_exists('mb_strlen') ? 'mb_strlen' : 'strlen';
        //Read that stuff chunk by chunk (whatever buffersize there is)
        $result = $substr($this->data, $this->position, $length);
        $this->position += $strlen($result);
        return $result;
    }