public stream_read ( integer $length ) : string | ||
$length | integer | the length of the chunk to read |
리턴 | 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;
}