public function _encode()
    {
        $data = "";
        foreach ($this->byteArray as $byte)
        {
            $data .= chr($byte);
        }

        return array(
            '__type' => 'Bytes',
            'base64' => base64_encode($data)
        );
    }