public static function fillBuffer(StreamInterface $stream, $bufferSize = 8192)
	{
		if(!$stream->isReadable())
		{
			throw new \InvalidArgumentException(sprintf('Stream is not readable: %s', get_class($stream)));
		}
		
		$buffer = '';
		
		while(!$stream->eof() && strlen($buffer) < $bufferSize)
		{
			$buffer .= $stream->read($bufferSize - strlen($buffer));
		}
		
		return $buffer;
	}