original_string: public static function bufferedReader(StreamInterface $stream, $bufferSize = 8192)
  	{
  		if(!$stream->isReadable())
  		{
  			throw new \InvalidArgumentException(sprintf('Stream is not readable: %s', get_class($stream)));
  		}
  		
  		$buffer = '';
  		
  		while(!$stream->eof())
  		{
  			$buffer .= $stream->read($bufferSize);
  			
  			while(strlen($buffer) >= $bufferSize)
  			{
  				yield (string)substr($buffer, 0, $bufferSize);
  				
  				$buffer = (string)substr($buffer, $bufferSize);
  			}
  		}
  		
  		if($buffer !== '')
  		{
  			yield $buffer;
  		}
  	}
code: public static function bufferedReader(StreamInterface $stream, $bufferSize = 8192)
  	{
  		if(!$stream->isReadable())
  		{
  			throw new \InvalidArgumentException(sprintf('Stream is not readable: %s', get_class($stream)));
  		}
  		
  		$buffer = '';
  		
  		while(!$stream->eof())
  		{
  			$buffer .= $stream->read($bufferSize);
  			
  			while(strlen($buffer) >= $bufferSize)
  			{
  				yield (string)substr($buffer, 0, $bufferSize);
  				
  				$buffer = (string)substr($buffer, $bufferSize);
  			}
  		}
  		
  		if($buffer !== '')
  		{
  			yield $buffer;
  		}
  	}
code_tokens: public static function bufferedReader ( StreamInterface $ stream , $ bufferSize = 8192 ) { if ( ! $ stream -> isReadable ( ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Stream is not readable: %s' , get_class ( $ stream ) ) ) ; } $ buffer = '' ; while ( ! $ stream -> eof ( ) ) { $ buffer .= $ stream -> read ( $ bufferSize ) ; while ( strlen ( $ buffer ) >= $ bufferSize ) { yield ( string ) substr ( $ buffer , 0 , $ bufferSize ) ; $ buffer = ( string ) substr ( $ buffer , $ bufferSize ) ; } } if ( $ buffer !== '' ) { yield $ buffer ; } }
docstring: Turn a stream into an iterator returning even-sized results.
  
  @param StreamInterface $stream
  @param int $bufferSize
  @return \Iterator
  
  @throws \InvalidArgumentException When the stream is not readable.
docstring_tokens: Turn a stream into an iterator returning even - sized results .