public function setEntity($entity, $prepare = true)
	{
		if($entity instanceof EntityInterface)
		{
			$this->entity = $entity;
		}
		elseif(is_resource($entity) || $entity instanceof StreamInterface)
		{
			$this->entity = new StreamEntity($entity);
		}
		elseif((is_array($entity) || is_object($entity)) && is_callable($entity))
		{
			$this->entity = new CallbackEntity($entity);
		}
		else
		{
			$this->entity = new StringEntity($entity);
		}
		
		if($prepare)
		{
			$this->entity->prepare($this);
		}
		
		return $this;
	}