(reader: BinaryReader, len: number, encoding: Encoding)
| 93 | } |
| 94 | |
| 95 | public decode(reader: BinaryReader, len: number, encoding: Encoding): string { |
| 96 | if (!len) { |
| 97 | return ""; |
| 98 | } |
| 99 | switch (encoding) { |
| 100 | case Encoding.LOWER_SPECIAL: |
| 101 | return this.decodeLowerSpecial(reader.bufferRef(len)); |
| 102 | case Encoding.LOWER_UPPER_DIGIT_SPECIAL: |
| 103 | return this.decodeLowerUpperDigitSpecial(reader.bufferRef(len)); |
| 104 | case Encoding.FIRST_TO_LOWER_SPECIAL: |
| 105 | return this.decodeRepFirstLowerSpecial(reader.bufferRef(len)); |
| 106 | case Encoding.ALL_TO_LOWER_SPECIAL: |
| 107 | return this.decodeRepAllToLowerSpecial(reader.bufferRef(len)); |
| 108 | case Encoding.UTF_8: |
| 109 | return reader.stringUtf8(len); |
| 110 | default: |
| 111 | throw new Error("Unexpected encoding flag: " + encoding); |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | /** Decoding method for {@link Encoding#LOWER_SPECIAL}. */ |
| 116 | private decodeLowerSpecial(data: Uint8Array) { |
nothing calls this directly
no test coverage detected