(value)
| 140 | } |
| 141 | |
| 142 | writeNybble(value) { |
| 143 | let output = this.output; |
| 144 | |
| 145 | if ((value < 0) || (value > 15)) |
| 146 | throw new Error("invalid nybble"); |
| 147 | |
| 148 | if (output.firstNybble) { |
| 149 | output[output.position] = value; |
| 150 | |
| 151 | output.firstNybble = false; |
| 152 | } |
| 153 | else { |
| 154 | output[output.position] |= value << 4; |
| 155 | |
| 156 | output.position += 1; |
| 157 | output.firstNybble = true; |
| 158 | } |
| 159 | } |
| 160 | } |