public function convert(string $string): string
    {
        if ($this->encoding === null) {
            $this->encoding = $this->getEncoding($string);
        }

        if ($this->encoding === self::UTF16BE) {
            $string = mb_convert_encoding($string, "UTF-8", "UTF-16BE");
        }

        if ($this->encoding === self::UTF16LE) {
            $string = mb_convert_encoding($string, "UTF-8", "UTF-16LE");
        }

        return $string;
    }