(record)
| 211 | this.writeBytes(data); |
| 212 | } |
| 213 | writeRecord(record) { |
| 214 | this.writeName(record.name); |
| 215 | this.writeU16(record.type); |
| 216 | this.writeU16(record.clss); |
| 217 | |
| 218 | if (undefined === record.ttl) |
| 219 | return; |
| 220 | |
| 221 | this.writeU32(record.ttl); |
| 222 | |
| 223 | const state = this.state; |
| 224 | const position = state.position; |
| 225 | this.writeU16(0); |
| 226 | let length = state.position; |
| 227 | this.writeRData(record.type, record.data); |
| 228 | |
| 229 | if (state.result) { |
| 230 | length = state.position - length; |
| 231 | state.result[position] = length >> 8; |
| 232 | state.result[position + 1] = length; |
| 233 | } |
| 234 | } |
| 235 | writeSections() { |
| 236 | for (let i = 0, sections = this.sections, length = sections.length; i < length; i++) |
| 237 | sections[i].forEach(record => this.writeRecord(record)); |
no test coverage detected