public function setData($data, $encoding = self::ENCODING_URL_ENCODED_OCTETS)
    {
        switch ($encoding) {
            case self::ENCODING_URL_ENCODED_OCTETS:
                $this->encoding = self::ENCODING_URL_ENCODED_OCTETS;
                $this->encodedData = rawurlencode($data);
                break;
            case self::ENCODING_BASE64:
                $this->encoding = self::ENCODING_BASE64;
                $this->encodedData = base64_encode($data);
                break;
            default:
                throw new \InvalidArgumentException('Unsupported encoding scheme');
                break;
        }
    }