public function flush()
	{
		if($this->stream === NULL)
		{
			throw new \RuntimeException(sprintf('Cannot flush detached stream'));
		}
		
		if(strlen($this->buffer))
		{
			$this->stream->write(sprintf("%X\r\n%s\r\n", strlen($this->buffer), $this->buffer));
			$this->buffer = '';
		}
	}