static decode(codewords, ecLevel) {
			// pass encoding to result (will be used for decode symbols in byte mode)
			let result = new StringBuilder('');
			// let encoding: Charset = StandardCharsets.ISO_8859_1;
			let encoding = CharacterSetECI.ISO8859_1;
			/**
			 * @note the next command is specific from this TypeScript library
			 * because TS can't properly cast some values to char and
			 * convert it to string later correctly due to encoding
			 * differences from Java version. As reported here:
			 * https://github.com/zxing-js/library/pull/264/files#r382831593
			 */
			result.enableDecoding(encoding);
			// Get compaction mode
			let codeIndex = 1;
			let code = codewords[codeIndex++];
			let resultMetadata = new PDF417ResultMetadata();
			while (codeIndex < codewords[0]) {
				switch (code) {
					case DecodedBitStreamParser$2.TEXT_COMPACTION_MODE_LATCH:
						codeIndex = DecodedBitStreamParser$2.textCompaction(codewords, codeIndex, result);
						break;
					case DecodedBitStreamParser$2.BYTE_COMPACTION_MODE_LATCH:
					case DecodedBitStreamParser$2.BYTE_COMPACTION_MODE_LATCH_6:
						codeIndex = DecodedBitStreamParser$2.byteCompaction(code, codewords, encoding, codeIndex, result);
						break;
					case DecodedBitStreamParser$2.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:
						result.append(/*(char)*/ codewords[codeIndex++]);
						break;
					case DecodedBitStreamParser$2.NUMERIC_COMPACTION_MODE_LATCH:
						codeIndex = DecodedBitStreamParser$2.numericCompaction(codewords, codeIndex, result);
						break;
					case DecodedBitStreamParser$2.ECI_CHARSET:
						let charsetECI = CharacterSetECI.getCharacterSetECIByValue(codewords[codeIndex++]);
						// encoding = Charset.forName(charsetECI.getName());
						break;
					case DecodedBitStreamParser$2.ECI_GENERAL_PURPOSE:
						// Can't do anything with generic ECI; skip its 2 characters
						codeIndex += 2;
						break;
					case DecodedBitStreamParser$2.ECI_USER_DEFINED:
						// Can't do anything with user ECI; skip its 1 character
						codeIndex++;
						break;
					case DecodedBitStreamParser$2.BEGIN_MACRO_PDF417_CONTROL_BLOCK:
						codeIndex = DecodedBitStreamParser$2.decodeMacroBlock(codewords, codeIndex, resultMetadata);
						break;
					case DecodedBitStreamParser$2.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:
					case DecodedBitStreamParser$2.MACRO_PDF417_TERMINATOR:
						// Should not see these outside a macro block
						throw new FormatException();
					default:
						// Default to text compaction. During testing numerous barcodes
						// appeared to be missing the starting mode. In these cases defaulting
						// to text compaction seems to work.
						codeIndex--;
						codeIndex = DecodedBitStreamParser$2.textCompaction(codewords, codeIndex, result);
						break;
				}
				if (codeIndex < codewords.length) {
					code = codewords[codeIndex++];
				}
				else {
					throw FormatException.getFormatInstance();
				}
			}
			if (result.length() === 0) {
				throw FormatException.getFormatInstance();
			}
			let decoderResult = new DecoderResult(null, result.toString(), null, ecLevel);
			decoderResult.setOther(resultMetadata);
			return decoderResult;
		}
@param codewords
@param ecLevel

@throws FormatException