static decode(bytes) {
			const bits = new BitSource(bytes);
			const result = new StringBuilder();
			const resultTrailer = new StringBuilder();
			const byteSegments = new Array();
			let mode = Mode.ASCII_ENCODE;
			do {
				if (mode === Mode.ASCII_ENCODE) {
					mode = this.decodeAsciiSegment(bits, result, resultTrailer);
				}
				else {
					switch (mode) {
						case Mode.C40_ENCODE:
							this.decodeC40Segment(bits, result);
							break;
						case Mode.TEXT_ENCODE:
							this.decodeTextSegment(bits, result);
							break;
						case Mode.ANSIX12_ENCODE:
							this.decodeAnsiX12Segment(bits, result);
							break;
						case Mode.EDIFACT_ENCODE:
							this.decodeEdifactSegment(bits, result);
							break;
						case Mode.BASE256_ENCODE:
							this.decodeBase256Segment(bits, result, byteSegments);
							break;
						default:
							throw new FormatException();
					}
					mode = Mode.ASCII_ENCODE;
				}
			} while (mode !== Mode.PAD_ENCODE && bits.available() > 0);
			if (resultTrailer.length() > 0) {
				result.append(resultTrailer.toString());
			}
			return new DecoderResult(bytes, result.toString(), byteSegments.length === 0 ? null : byteSegments, null);
		}
<p>Data Matrix Codes can encode text as bits in one of several modes, and can use multiple modes
in one Data Matrix Code. This class decodes the bits back into text.</p>

<p>See ISO 16022:2006, 5.2.1 - 5.2.9.2</p>

@author bbrown@google.com (Brian Brown)
@author Sean Owen