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;
		}
	}